Programming C# 4.0 (6TH)

個数:

Programming C# 4.0 (6TH)

  • 提携先の海外書籍取次会社に在庫がございます。通常2週間で発送いたします。
    重要ご説明事項
    1. 納期遅延や、ご入手不能となる場合が若干ございます。
    2. 複数冊ご注文の場合、分割発送となる場合がございます。
    3. 美品のご指定は承りかねます。
  • ≪洋書のご注文につきまして≫ 「海外取次在庫あり」および「国内仕入れ先からお取り寄せいたします」表示の商品でも、納期の目安期間内にお届けできないことがございます。あらかじめご了承ください。

  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 830 p.
  • 言語 ENG,ENG
  • 商品コード 9780596159832
  • DDC分類 005.133

Full Description


With dynamic typing and many other new features, C# 4.0 has already piqued the interest of .NET developers worldwide. This bestselling tutorial for beginning to intermediate programmers teaches you how to use the new version of the C# language to build web, desktop, and rich Internet applications with the .NET 4.0 Framework. In this sixth edition, .NET experts Ian Griffiths and Matthew Adams cover the latest enhancements to the language, as well as the fundamentals of both C# and .NET. The book explains concurrent programming with C# 4.0, and teaches you how to use C# with .NET tools such as the Entity Framework for easier data access, and the Silverlight platform for browser-based RIA development. With "Programming C# 4.0", you will: learn C# and .NET programming with a comprehensive tutorial that also serves as a useful reference; find many more useful code examples than in previous editions; learn basic language and framework features, from classes to assemblies; get details on new C# 4.0 features and capabilities, from optional and named arguments to dynamic and concurrent programming; and, learn about LINQ, anonymous delegates, and lambda expressions. "Programming C# 4.0" provides a clear and concise way for programmers to learn C# 4.0 quickly and thoroughly. No prior .NET experience is required for you to get started.

Table of Contents

Preface                                            xv
1 Introducing C# 1 (10)
Why C#? Why .NET? 1 (1)
The .NET Framework Class Library 2 (1)
Language Style 3 (4)
Composability 4 (1)
Managed Code 5 (1)
Continuity and the Windows Ecosystem 6 (1)
C# 4.0, .NET 4, and Visual Studio 2010 7 (2)
Summary 9 (2)
2 Basic Programming Techniques 11 (48)
Getting Started 11 (3)
Namespaces and Types 14 (5)
Projects and Solutions 19 (5)
Comments, Regions, and Readability 24 (4)
Bad Comments 26 (1)
XML Documentation Comments 26 (2)
Variables 28 (7)
Variable Types 28 (7)
Expressions and Statements 35 (4)
Assignment Statements 38 (1)
Increment and Decrement Operators 38 (1)
Flow Control with Selection Statements 39 (8)
if Statements 40 (5)
switch and case Statements 45 (2)
Iteration Statements 47 (8)
foreach Statements 48 (2)
for Statements 50 (2)
while and do Statements 52 (1)
Breaking Out of a Loop 53 (2)
Methods 55 (3)
Summary 58 (1)
3 Abstracting Ideas with Classes and Structs 59 (44)
Divide and Conquer 59 (5)
Abstracting Ideas with Methods 59 (3)
Abstracting Ideas with Objects and Classes 62 (2)
Defining Classes 64 (15)
Representing State with Properties 64 (2)
Protection Levels 66 (2)
Initializing with a Constructor 68 (4)
Fields: A Place to Put Data 72 (3)
Fields Can Be Fickle, but const Is Forever 75 (1)
Read-only Fields and Properties 76 (3)
Related Constants with enum 79 (3)
Value Types and Reference Types 82 (6)
Too Many Constructors, Mr. Mozart 88 (1)
Overloading 88 (4)
Overloaded Methods and Default Named 89 (3)
Parameters
Object Initializers 92 (3)
Defining Methods 95 (4)
Declaring Static Methods 98 (1)
Static Fields and Properties 99 (3)
Static Constructors 101(1)
Summary 102(1)
4 Extensibility and Polymorphism 103(40)
Association Through Composition and 104(2)
Aggregation
Inheritance and Polymorphism 106(3)
Replacing Methods in Derived Classes 109(5)
Hiding Base Members with new 109(3)
Replacing Methods with virtual and override 112(2)
Inheritance and Protection 114(2)
Calling Base Class Methods 116(2)
Thus Far and No Farther: sealed 118(3)
Requiring Overrides with abstract 121(6)
All Types Are Derived from Object 127(5)
Boxing and Unboxing Value Types 127(5)
C# Does Not Support Multiple Inheritance of 132(1)
Implementation
C# Supports Multiple Inheritance of Interface 132(3)
Deriving Interfaces from Other Interfaces 135(6)
Explicit Interface Implementation 136(5)
The Last Resort: Checking Types at Runtime 141(1)
Summary 142(1)
5 Composability and Extensibility with Delegates 143(42)
Functional Composition with delegate 150(6)
Generic Actions with Action <T> 156(4)
Generic Predicates with Predicate <T> 160(2)
Using Anonymous Methods 162(1)
Creating Delegates with Lambda Expressions 163(2)
Delegates in Properties 165(2)
Generic Delegates for Functions 167(4)
Notifying Clients with Events 171(12)
Exposing Large Numbers of Events 180(3)
Summary 183(2)
6 Dealing with Errors 185(36)
When and How to Fail 191(3)
Returning Error Values 194(7)
Debugging with Return Values 200(1)
Exceptions 201(19)
Handling Exceptions 207(7)
When Do finally Blocks Run? 214(1)
Deciding What to Catch 215(3)
Custom Exceptions 218(2)
Summary 220(1)
7 Arrays and Lists 221(44)
Arrays 221(22)
Construction and Initialization 222(3)
Custom Types in Arrays 225(5)
Array Members 230(6)
Array Size 236(7)
List<T< 243(11)
Custom Indexers 247(6)
Finding and Sorting 253(1)
Collections and Polymorphism 254(10)
Creating Your Own IEnumerable<T< 258(6)
Summary 264(1)
8 LINQ 265(34)
Query Expressions 265(6)
Query Expressions Versus Method Calls 267(1)
Extension Methods and LING 268(3)
let Clauses 271(1)
LINQ Concepts and Techniques 271(4)
Delegates and Lambdas 271(2)
Functional Style and Composition 273(1)
Deferred Execution 274(1)
LINQ Operators 275(22)
Filtering 275(1)
Ordering 276(3)
Concatenation 279(1)
Grouping 280(2)
Projections 282(6)
Zipping 288(1)
Getting Selective 289(2)
Testing the Whole Collection 291(1)
Aggregation 292(2)
Set Operations 294(1)
Joining 295(1)
Conversions 296(1)
Summary 297(2)
9 Collection Classes 299(16)
Dictionaries 299(11)
Common Dictionary Uses 301(7)
IDictionary<TKey, TValue> 308(1)
Dictionaries and LINQ 309(1)
HashSet and SortedSet 310(1)
Queues 311(1)
Linked Lists 312(1)
Stacks 313(1)
Summary 314(1)
10 Strings 315(56)
What Is a String? 316(1)
The String and Char Types 317(1)
Literal Strings and Chars 318(4)
Escaping Special Characters 319(3)
Formatting Data for Output 322(16)
Standard Numeric Format Strings 323(6)
Custom Numeric Format Strings 329(3)
Dates and Times 332(4)
Going the Other Way: Converting Strings to 336(1)
Other Types
Composite Formatting with String.Format 337(1)
Culture Sensitivity 338(3)
Exploring Formatting Rules 340(1)
Accessing Characters by Index 341(1)
Strings Are Immutable 341(2)
Getting a Range of Characters 343(1)
Composing Strings 344(4)
Splitting It Up Again 346(1)
Upper- and Lowercase 347(1)
Manipulating Text 348(5)
Mutable Strings with StringBuilder 349(4)
Finding and Replacing Content 353(2)
All Sorts of "Empty" Strings 355(2)
Trimming Whitespace 357(3)
Checking Character Types 360(1)
Encoding Characters 360(10)
Why Encodings Matter 362(1)
Encoding and Decoding 363(7)
Why Represent Strings As Byte Sequences? 370(1)
Summary 370(1)
11 Files and Streams 371(78)
Inspecting Directories and Files 371(3)
Examining Directories 374(1)
Manipulating File Paths 375(2)
Path and the Current Working Directory 376(1)
Examining File Information 377(4)
Creating Temporary Files 381(1)
Deleting Files 381(2)
Well-Known Folders 383(4)
Concatenating Path Elements Safely 387(1)
Creating and Securing Directory Hierarchies 388(6)
Deleting a Directory 394(2)
Writing Text Files 396(4)
Writing a Whole Text File at Once 396(1)
Writing Text with a StreamWriter 397(3)
When Files Go Bad: Dealing with Exceptions 400(9)
Finding and Modifying Permissions 404(5)
Reading Files into Memory 409(4)
Streams 413(9)
Moving Around in a Stream 419(2)
Writing Data with Streams 421(1)
Reading, Writing, and Locking Files 422(1)
FileStream Constructors 423(2)
Stream Buffers 423(1)
Setting Permissions During Construction 424(1)
Setting Advanced Options 425(1)
Asynchronous File Operations 425(3)
Isolated Storage 428(11)
Stores 429(1)
Reading and Writing Text 430(1)
Defining "Isolated" 431(5)
Managing User Storage with Quotas 436(1)
Managing Isolated Storage 436(3)
Streams That Aren't Files 439(8)
An Adapting Stream: CryptoStream 443(1)
In Memory Alone: The MemoryStream 444(1)
Representing Binary As Text with Base64 444(3)
Encoding
Summary 447(2)
12 XML 449(24)
XML Basics (A Quick Review) 449(3)
Elements 450(1)
XHTML 451(1)
X Stands for eXtensible 452(1)
Creating XML Documents 452(9)
XML Elements 455(1)
XML Attributes 456(3)
Putting the LINQ in LINQ to XML 459(2)
Searching in XML with LINQ 461(6)
Searching for a Single Node 465(1)
Search Axes 466(1)
Where Clauses 466(1)
XML Serialization 467(4)
Customizing XML Serialization Using 469(2)
Attributes
Summary 471(2)
13 Networking 473(66)
Choosing a Networking Technology 473(8)
Web Application with Client-Side Code 474(3)
.NET Client and .NET Server 477(2)
.NET Client and External Party Web Service 479(1)
External Client and .NET Web Service 480(1)
WCF 481(30)
Creating a WCF Project 481(1)
WCF Contracts 482(1)
WCF Test Client and Host 483(3)
Hosting a WCF Service 486(7)
Writing a WCF Client 493(8)
Bidirectional Communication with Duplex 501(10)
Contracts
HTTP 511(11)
WebClient 512(4)
WebRequest and WebResponse 516(6)
Sockets 522(14)
IP, IPv6, and TCP 523(5)
Connecting to Services with the Socket Class 528(3)
Implementing Services with the Socket Class 531(5)
Other Networking Features 536(1)
Summary 537(2)
14 Databases 539(50)
The .NET Data Access Landscape 539(9)
Classic ADO.NET 540(4)
LINQ and Databases 544(1)
Non-Microsoft Data Access Technologies 545(1)
WCF Data Services 546(1)
Silverlight and Data Access 546(1)
Databases 547(1)
The Entity Data Model 548(15)
Generated Code 551(3)
Changing the Mapping 554(1)
Relationships 555(7)
Inheritance 562(1)
Queries 563(8)
LINQ to Entities 563(5)
Entity SQL 568(2)
Mixing ESQL and LINQ 570(1)
The EntityClient ADO.NET Provider 571(1)
Object Context 571(13)
Connection Handling 571(3)
Creating, Updating, and Deleting 574(2)
Transactions 576(5)
Optimistic Concurrency 581(2)
Context and Entity Lifetime 583(1)
WCF Data Services 584(4)
Summary 588(1)
15 Assemblies 589(18)
.NET Components: Assemblies 589(9)
References 590(3)
Writing Libraries 593(2)
Protection 595(3)
Naming 598(3)
Signing and Strong Names 599(2)
Loading 601(4)
Loading from the Application Folder 602(1)
Loading from the GAC 603(1)
Loading from a Silverlight .xap File 603(1)
Explicit Loading 604(1)
Summary 605(2)
16 Threads and Asynchronous Code 607(64)
Threads 609(25)
Threads and the OS Scheduler 611(2)
The Stack 613(7)
The Thread Pool 620(2)
Thread Affinity and Context 622(1)
Common Thread Misconceptions 623(6)
Multithreaded Coding Is Hard 629(3)
Multithreading Survival Strategies 632(2)
Synchronization Primitives 634(17)
Monitor 634(11)
Other Lock Types 645(4)
Other Coordination Mechanisms 649(1)
Events 649(1)
Countdown 650(1)
BlockingCollection 650(1)
Asynchronous Programming 651(5)
The Asynchronous Programming Model 652(3)
The Event-Based Asynchronous Pattern 655(1)
Ad Hoc Asynchrony 656(1)
The Task Parallel Library 656(10)
Tasks 657(6)
Cancellation 663(2)
Error Handling 665(1)
Data Parallelism 666(4)
Parallel For and ForEach 667(2)
PLINQ: Parallel LINQ 669(1)
Summary 670(1)
17 Attributes and Reflection 671(16)
Attributes 671(6)
Types of Attributes 672(1)
Custom Attributes 673(4)
Reflection 677(9)
Inspecting Metadata 678(1)
Type Discovery 679(2)
Reflecting on a Specific Type 681(2)
Late Binding 683(3)
Summary 686(1)
18 Dynamic 687(20)
Static Versus Dynamic 687(3)
The Dynamic Style and COM Automation 689(1)
The dynamic Type 690(13)
Object Types and dynamic 693(10)
dynamic in Noninterop Scenarios? 703(3)
Summary 706(1)
19 Interop with COM and Win32 707(22)
Importing ActiveX Controls 707(4)
Importing a Control in .NET 708(3)
Interop Assemblies 711(2)
No PIA 712(1)
64-bit Versus 32-bit 713(3)
P/Invoke 716(4)
Pointers 720(5)
C# 4.0 Interop Syntax Enhancements 725(2)
Indexed Properties 725(1)
Optional ref 726(1)
Summary 727(2)
20 WPF and Silverlight 729(46)
Xaml and Code Behind 731(7)
Xaml and Objects 735(3)
Elements and Controls 738(23)
Layout Panels 739(9)
Graphical Elements 748(7)
Controls 755(5)
User Controls 760(1)
Control Templates 761(6)
Styles 764(2)
The Visual State Manager 766(1)
Data Binding 767(6)
Data Templates 769(4)
Summary 773(2)
21 Programming ASP.NET Applications 775(20)
Web Forms Fundamentals 775(4)
Web Forms Events 776(2)
Web Forms Life Cycle 778(1)
Creating a Web Application 779(5)
Code-Behind Files 780(1)
Adding Controls 781(2)
Server Controls 783(1)
Data Binding 784(10)
Examining the Code 789(1)
Adding Controls and Events 790(4)
Summary 794(1)
22 Windows Forms 795(20)
Creating the Application 796(4)
Adding a Binding Source 797(3)
Controls 800(6)
Docking and Anchoring 805(1)
Data Binding 806(5)
Event Handling 811(2)
Summary 813(2)
Index 815