Introduction |
|
xxxi | |
|
|
|
|
3 | (10) |
|
What Is the .NET Framework? |
|
|
3 | (4) |
|
What's in the .NET Framework? |
|
|
4 | (1) |
|
Writing Applications Using the .NET Framework |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
Applications You Can Write with C# |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
8 | (2) |
|
Visual Studio Express 2012 Products |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
10 | (3) |
|
Chapter 2 Writing A C# Program |
|
|
13 | (12) |
|
The Visual Studio 2012 Development Environment |
|
|
14 | (2) |
|
|
16 | (4) |
|
|
18 | (1) |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
20 | (3) |
|
|
23 | (2) |
|
Chapter 3 Variables and Expressions |
|
|
25 | (24) |
|
|
26 | (2) |
|
Basic C# Console Application Structure |
|
|
28 | (1) |
|
|
29 | (8) |
|
|
29 | (4) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
34 | (2) |
|
Variable Declaration and Assignment |
|
|
36 | (1) |
|
|
37 | (8) |
|
|
37 | (4) |
|
|
41 | (1) |
|
|
42 | (1) |
|
|
42 | (3) |
|
|
45 | (4) |
|
|
49 | (30) |
|
|
49 | (9) |
|
Boolean Assignment Operators |
|
|
52 | (1) |
|
|
53 | (4) |
|
Operator Precedence Updated |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
59 | (6) |
|
|
59 | (1) |
|
|
59 | (3) |
|
Checking More Conditions Using if Statements |
|
|
62 | (1) |
|
|
63 | (2) |
|
|
65 | (10) |
|
|
66 | (2) |
|
|
68 | (2) |
|
|
70 | (4) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
75 | (4) |
|
Chapter 5 More About Variables |
|
|
79 | (26) |
|
|
80 | (6) |
|
|
80 | (1) |
|
|
81 | (3) |
|
Explicit Conversions Using the Convert Commands |
|
|
84 | (2) |
|
|
86 | (12) |
|
|
87 | (1) |
|
|
87 | (3) |
|
|
90 | (1) |
|
|
90 | (2) |
|
|
92 | (1) |
|
|
93 | (2) |
|
|
95 | (1) |
|
|
96 | (1) |
|
|
97 | (1) |
|
|
98 | (4) |
|
|
102 | (3) |
|
|
105 | (26) |
|
Defining and Using Functions |
|
|
106 | (10) |
|
|
108 | (1) |
|
|
109 | (2) |
|
|
111 | (1) |
|
|
111 | (2) |
|
Reference and Value Parameters |
|
|
113 | (2) |
|
|
115 | (1) |
|
|
116 | (5) |
|
Variable Scope in Other Structures |
|
|
118 | (2) |
|
Parameters and Return Values versus Global Data |
|
|
120 | (1) |
|
|
121 | (2) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
125 | (3) |
|
|
128 | (3) |
|
Chapter 7 Debugging and Error Handling |
|
|
131 | (26) |
|
Debugging in Visual Studio |
|
|
132 | (15) |
|
Debugging in Nonbreak (Normal) Mode |
|
|
132 | (1) |
|
Outputting Debugging Information |
|
|
133 | (4) |
|
|
137 | (2) |
|
Diagnostics Output Versus Tracepoints |
|
|
139 | (1) |
|
|
140 | (1) |
|
|
140 | (2) |
|
Monitoring Variable Content |
|
|
142 | (2) |
|
|
144 | (2) |
|
Immediate and Command Windows |
|
|
146 | (1) |
|
|
146 | (1) |
|
|
147 | (6) |
|
|
147 | (5) |
|
Listing and Configuring Exceptions |
|
|
152 | (1) |
|
Notes on Exception Handling |
|
|
152 | (1) |
|
|
153 | (4) |
|
Chapter 8 Introduction to Object-Oriented Programming |
|
|
157 | (20) |
|
What Is Object-Oriented Programming? |
|
|
158 | (5) |
|
|
158 | (1) |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
161 | (1) |
|
The Life Cycle of an Object |
|
|
161 | (1) |
|
|
161 | (1) |
|
|
162 | (1) |
|
Static and Instance Class Members |
|
|
162 | (1) |
|
|
162 | (1) |
|
|
163 | (1) |
|
|
163 | (8) |
|
|
163 | (1) |
|
|
164 | (1) |
|
|
165 | (2) |
|
|
167 | (1) |
|
|
168 | (1) |
|
Relationships Between Objects |
|
|
168 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
Reference Types Versus Value Types |
|
|
170 | (1) |
|
OOP in Desktop Applications |
|
|
171 | (3) |
|
|
174 | (3) |
|
Chapter 9 Defining Classes |
|
|
177 | (26) |
|
|
177 | (5) |
|
|
180 | (2) |
|
|
182 | (2) |
|
Constructors and Destructors |
|
|
184 | (4) |
|
Constructor Execution Sequence |
|
|
185 | (3) |
|
OOP Tools in Visual Studio |
|
|
188 | (5) |
|
|
188 | (2) |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
192 | (1) |
|
|
193 | (3) |
|
Interfaces Versus Abstract Classes |
|
|
196 | (2) |
|
|
198 | (2) |
|
Shallow Copying Versus Deep Copying |
|
|
200 | (1) |
|
|
200 | (3) |
|
Chapter 10 Defining Class Members |
|
|
203 | (32) |
|
|
203 | (10) |
|
|
204 | (1) |
|
|
204 | (1) |
|
|
205 | (5) |
|
Adding Members from a Class Diagram |
|
|
210 | (1) |
|
|
210 | (2) |
|
|
212 | (1) |
|
|
212 | (1) |
|
|
212 | (1) |
|
|
213 | (1) |
|
Additional Class Member Topics |
|
|
213 | (5) |
|
Hiding Base Class Methods |
|
|
213 | (2) |
|
Calling Overridden or Hidden Base Class Methods |
|
|
215 | (1) |
|
|
216 | (1) |
|
Using Nested Type Definitions |
|
|
216 | (2) |
|
|
218 | (3) |
|
Implementing Interfaces in Classes |
|
|
219 | (1) |
|
Explicit Interface Member Implementation |
|
|
220 | (1) |
|
Additional Property Accessors |
|
|
220 | (1) |
|
Partial Class Definitions |
|
|
221 | (1) |
|
Partial Method Definitions |
|
|
222 | (2) |
|
|
224 | (7) |
|
|
224 | (1) |
|
|
224 | (1) |
|
|
224 | (1) |
|
Writing the Class Library |
|
|
224 | (1) |
|
Adding the Suit and Rank Enumerations |
|
|
225 | (1) |
|
|
226 | (1) |
|
|
227 | (3) |
|
A Client Application for the Class Library |
|
|
230 | (1) |
|
The Call Hierarchy Window |
|
|
231 | (1) |
|
|
232 | (3) |
|
Chapter 11 Collections, Comparisons, and Conversions |
|
|
235 | (44) |
|
|
236 | (20) |
|
|
236 | (5) |
|
|
241 | (1) |
|
|
242 | (2) |
|
Adding a Cards Collection to CardLib |
|
|
244 | (3) |
|
Keyed Collections and IDictionary |
|
|
247 | (1) |
|
|
248 | (4) |
|
Iterators and Collections |
|
|
252 | (1) |
|
|
253 | (2) |
|
Adding Deep Copying to CardLib |
|
|
255 | (1) |
|
|
256 | (18) |
|
|
256 | (1) |
|
|
257 | (1) |
|
|
258 | (2) |
|
|
260 | (1) |
|
|
261 | (4) |
|
Adding Operator Overloads to CardLib |
|
|
265 | (4) |
|
The IComparable and IComparer Interfaces |
|
|
269 | (2) |
|
|
271 | (3) |
|
|
274 | (2) |
|
Overloading Conversion Operators |
|
|
274 | (1) |
|
|
275 | (1) |
|
|
276 | (3) |
|
|
279 | (34) |
|
|
280 | (1) |
|
|
281 | (15) |
|
|
281 | (1) |
|
Operators and Nullable Types |
|
|
282 | (1) |
|
|
283 | (4) |
|
The System.Collections.Generic Namespace |
|
|
287 | (1) |
|
|
287 | (2) |
|
Sorting and Searching Generic Lists |
|
|
289 | (5) |
|
|
294 | (1) |
|
Modifying CardLib to Use a Generic Collection Class |
|
|
295 | (1) |
|
|
296 | (12) |
|
|
296 | (2) |
|
|
298 | (1) |
|
|
298 | (6) |
|
Inheriting from Generic Classes |
|
|
304 | (1) |
|
|
305 | (1) |
|
|
306 | (1) |
|
Defining Generic Interfaces |
|
|
306 | (1) |
|
|
306 | (2) |
|
Defining Generic Delegates |
|
|
308 | (1) |
|
|
308 | (2) |
|
|
309 | (1) |
|
|
310 | (1) |
|
|
310 | (3) |
|
Chapter 13 Additional OOP Techniques |
|
|
313 | (26) |
|
The :: Operator and the Global Namespace Qualifier |
|
|
313 | (2) |
|
|
315 | (1) |
|
Adding Custom Exceptions to CardLib |
|
|
315 | (1) |
|
|
316 | (11) |
|
|
316 | (1) |
|
|
317 | (2) |
|
|
319 | (4) |
|
Multipurpose Event Handlers |
|
|
323 | (2) |
|
The EventHandler and Generic EventHandler<T>Types |
|
|
325 | (1) |
|
Return Values and Event Handlers |
|
|
326 | (1) |
|
|
326 | (1) |
|
Expanding and Using CardLib |
|
|
327 | (7) |
|
A Card Game Client for CardLib |
|
|
327 | (7) |
|
|
334 | (2) |
|
|
334 | (1) |
|
|
335 | (1) |
|
|
336 | (3) |
|
Chapter 14 C# Language Enhancements |
|
|
339 | (42) |
|
|
340 | (4) |
|
|
340 | (2) |
|
|
342 | (2) |
|
|
344 | (2) |
|
|
346 | (4) |
|
|
350 | (4) |
|
|
350 | (4) |
|
IDynamicMetaObjectProvider |
|
|
354 | (1) |
|
Advanced Method Parameters |
|
|
354 | (6) |
|
|
354 | (1) |
|
Optional Parameter Values |
|
|
355 | (1) |
|
The OptionalAttribute Attribute |
|
|
356 | (1) |
|
|
356 | (1) |
|
|
356 | (4) |
|
Named and Optional Parameter Guidelines |
|
|
360 | (1) |
|
|
360 | (4) |
|
|
364 | (8) |
|
|
364 | (1) |
|
Lambda Expressions for Anonymous Methods |
|
|
365 | (3) |
|
Lambda Expression Parameters |
|
|
368 | (1) |
|
Lambda Expression Statement Bodies |
|
|
368 | (1) |
|
Lambda Expressions as Delegates and Expression Trees |
|
|
369 | (1) |
|
Lambda Expressions and Collections |
|
|
370 | (2) |
|
Caller Information Attributes |
|
|
372 | (3) |
|
|
375 | (6) |
|
PART II WINDOWS PROGRAMMING |
|
|
|
Chapter 15 Basic Desktop Programming |
|
|
381 | (44) |
|
|
382 | (2) |
|
|
382 | (1) |
|
|
383 | (1) |
|
|
383 | (1) |
|
|
384 | (1) |
|
|
384 | (9) |
|
|
385 | (1) |
|
|
386 | (1) |
|
|
387 | (1) |
|
|
388 | (1) |
|
|
388 | (1) |
|
|
389 | (1) |
|
|
390 | (1) |
|
|
390 | (2) |
|
|
392 | (1) |
|
|
393 | (8) |
|
|
393 | (1) |
|
Alignment, Margins, Padding, and Dimensions |
|
|
393 | (1) |
|
|
394 | (1) |
|
|
394 | (1) |
|
|
395 | (2) |
|
|
397 | (1) |
|
|
398 | (1) |
|
|
398 | (3) |
|
|
401 | (20) |
|
|
401 | (1) |
|
Designing the User Interface |
|
|
401 | (1) |
|
|
401 | (1) |
|
|
402 | (1) |
|
|
402 | (1) |
|
|
402 | (3) |
|
|
405 | (1) |
|
|
406 | (1) |
|
|
406 | (1) |
|
|
407 | (1) |
|
|
408 | (1) |
|
|
409 | (2) |
|
Handling Events in the Options Window |
|
|
411 | (2) |
|
|
413 | (1) |
|
|
414 | (1) |
|
|
414 | (1) |
|
Static Binding to External Objects |
|
|
414 | (1) |
|
Dynamic Binding to External Objects |
|
|
415 | (3) |
|
|
418 | (1) |
|
|
418 | (3) |
|
|
421 | (4) |
|
Chapter 16 Advanced Desktop Programming |
|
|
425 | (44) |
|
|
425 | (4) |
|
|
426 | (1) |
|
Routed Commands with Menus |
|
|
426 | (3) |
|
Creating and Styling Controls |
|
|
429 | (9) |
|
|
430 | (1) |
|
|
430 | (4) |
|
|
434 | (1) |
|
The IValueConverter Interface |
|
|
434 | (1) |
|
|
434 | (1) |
|
|
435 | (1) |
|
|
436 | (1) |
|
Timelines without Key Frames |
|
|
436 | (1) |
|
Timelines with Key Frames |
|
|
437 | (1) |
|
|
438 | (9) |
|
Implementing Dependency Properties |
|
|
439 | (8) |
|
|
447 | (19) |
|
Refactoring the Domain Model |
|
|
447 | (4) |
|
|
451 | (8) |
|
|
459 | (7) |
|
|
466 | (3) |
|
Chapter 17 Windows Store Apps |
|
|
469 | (44) |
|
|
469 | (2) |
|
Windows 8 Developer License |
|
|
470 | (1) |
|
|
470 | (1) |
|
Windows Store Apps versus Desktop Applications |
|
|
471 | (1) |
|
Developing Windows Store Apps |
|
|
472 | (4) |
|
|
472 | (1) |
|
|
473 | (1) |
|
|
473 | (1) |
|
|
473 | (1) |
|
|
473 | (1) |
|
|
473 | (1) |
|
|
473 | (1) |
|
|
474 | (1) |
|
|
475 | (1) |
|
|
476 | (1) |
|
|
476 | (1) |
|
|
476 | (1) |
|
|
476 | (9) |
|
WPF and Windows Store App XAML Differences |
|
|
476 | (1) |
|
|
477 | (1) |
|
|
477 | (1) |
|
|
477 | (1) |
|
|
477 | (1) |
|
|
478 | (1) |
|
|
478 | (1) |
|
|
478 | (1) |
|
|
478 | (1) |
|
Grouped Items and Group Details Pages |
|
|
478 | (1) |
|
|
479 | (1) |
|
|
479 | (1) |
|
|
479 | (1) |
|
|
479 | (1) |
|
Serialization, Streams, and Async Programming |
|
|
480 | (3) |
|
|
483 | (2) |
|
|
485 | (1) |
|
Converting KarliCards, Part 1 |
|
|
485 | (14) |
|
Creating the CardLib Project |
|
|
486 | (3) |
|
Converting the View Models |
|
|
489 | (4) |
|
|
493 | (1) |
|
Drop Shadow and Opacity Masks |
|
|
493 | (1) |
|
|
493 | (1) |
|
|
493 | (6) |
|
Common Elements of Windows Store Apps |
|
|
499 | (5) |
|
|
500 | (1) |
|
|
501 | (2) |
|
Tiles, Badges, and Splash Screens |
|
|
503 | (1) |
|
Converting KarliCards, Part 2 |
|
|
504 | (5) |
|
|
509 | (1) |
|
Checking the Store Requirements |
|
|
509 | (1) |
|
|
510 | (3) |
|
Chapter 18 Deploying Desktop Applications |
|
|
513 | (22) |
|
|
514 | (1) |
|
|
514 | (10) |
|
Implementing ClickOnce Deployment |
|
|
515 | (7) |
|
Installing the Application with ClickOnce |
|
|
522 | (2) |
|
Creating and Using Updates of the Application |
|
|
524 | (1) |
|
InstallShield Limited Edition |
|
|
524 | (6) |
|
|
524 | (1) |
|
Step 1 Application Information |
|
|
525 | (1) |
|
Step 2 Installation Requirements |
|
|
525 | (1) |
|
Step 3 Installation Architecture |
|
|
526 | (1) |
|
|
526 | (1) |
|
Step 5 Application Shortcuts |
|
|
527 | (1) |
|
Step 6 Application Registry |
|
|
528 | (1) |
|
Step 7 Installation Interview |
|
|
528 | (2) |
|
|
530 | (5) |
|
|
|
Chapter 19 ASP.NET Web Programming |
|
|
535 | (56) |
|
Overview of Web Applications |
|
|
536 | (1) |
|
|
536 | (1) |
|
|
536 | (8) |
|
|
544 | (1) |
|
|
545 | (5) |
|
|
550 | (3) |
|
|
553 | (4) |
|
|
557 | (5) |
|
Client-Side State Management |
|
|
558 | (1) |
|
|
558 | (1) |
|
|
559 | (1) |
|
Server-Side State Management |
|
|
560 | (1) |
|
|
560 | (1) |
|
|
561 | (1) |
|
|
562 | (1) |
|
|
562 | (4) |
|
|
566 | (5) |
|
|
571 | (2) |
|
Authentication and Authorization |
|
|
573 | (7) |
|
Authentication Configuration |
|
|
574 | (3) |
|
|
577 | (3) |
|
Reading from and Writing to a SQL Server Database |
|
|
580 | (9) |
|
|
589 | (2) |
|
Chapter 20 Deploying Web Applications |
|
|
591 | (14) |
|
Internet Information Services |
|
|
591 | (1) |
|
|
592 | (2) |
|
|
594 | (3) |
|
Publishing a Web Application |
|
|
597 | (3) |
|
|
600 | (5) |
|
|
|
Chapter 21 File System Data |
|
|
605 | (34) |
|
|
605 | (1) |
|
The Classes for Input and Output |
|
|
606 | (22) |
|
The File and Directory Classes |
|
|
607 | (1) |
|
|
608 | (2) |
|
|
610 | (1) |
|
Path Names and Relative Paths |
|
|
611 | (1) |
|
|
611 | (1) |
|
|
612 | (1) |
|
|
613 | (2) |
|
|
615 | (2) |
|
|
617 | (1) |
|
|
618 | (2) |
|
|
620 | (1) |
|
|
621 | (4) |
|
|
625 | (1) |
|
Reading and Writing Compressed Files |
|
|
625 | (3) |
|
|
628 | (4) |
|
Monitoring the File System |
|
|
632 | (4) |
|
|
636 | (3) |
|
|
639 | (24) |
|
|
640 | (7) |
|
|
640 | (1) |
|
|
641 | (1) |
|
|
641 | (1) |
|
The Structure of an XML Document |
|
|
642 | (1) |
|
|
642 | (1) |
|
Well-Formed and Valid XML |
|
|
643 | (1) |
|
|
644 | (1) |
|
|
644 | (1) |
|
The XSD dialog box shown in the XmlDocument Class |
|
|
645 | (2) |
|
Using XML in Your Application |
|
|
647 | (14) |
|
XML Document Object Model |
|
|
647 | (1) |
|
|
648 | (1) |
|
|
648 | (4) |
|
Changing the Values of Nodes |
|
|
652 | (4) |
|
|
656 | (1) |
|
|
657 | (4) |
|
|
661 | (2) |
|
Chapter 23 Introduction to Linq |
|
|
663 | (36) |
|
|
664 | (3) |
|
Declaring a Variable for Results Using the var Keyword |
|
|
665 | (1) |
|
Specifying the Data Source: from Clause |
|
|
666 | (1) |
|
Specify Condition: where Clause |
|
|
666 | (1) |
|
Selecting Items: select Clause |
|
|
666 | (1) |
|
Finishing Up: Using the foreach Loop |
|
|
667 | (1) |
|
|
667 | (1) |
|
Using the LINQ Method Syntax |
|
|
667 | (2) |
|
|
667 | (1) |
|
Query Syntax versus Method Syntax |
|
|
668 | (1) |
|
|
669 | (1) |
|
Understanding the orderby Clause |
|
|
670 | (1) |
|
Ordering Using Method Syntax |
|
|
671 | (1) |
|
Querying a Large Data Set |
|
|
672 | (2) |
|
Using Aggregate Operators |
|
|
674 | (4) |
|
|
678 | (3) |
|
Projection: Creating New Objects in Queries |
|
|
681 | (1) |
|
Projection: Method Syntax |
|
|
682 | (1) |
|
Using the Select Distinct Query |
|
|
683 | (1) |
|
Using the Any and All Methods |
|
|
684 | (1) |
|
Ordering by Multiple Levels |
|
|
685 | (2) |
|
Multi-Level Ordering Method Syntax: ThenBy |
|
|
687 | (1) |
|
|
687 | (2) |
|
|
689 | (2) |
|
Using First and FirstOrDefault |
|
|
691 | (1) |
|
Using the LINQ Set Operators |
|
|
692 | (2) |
|
|
694 | (2) |
|
|
696 | (3) |
|
|
699 | (28) |
|
|
699 | (1) |
|
Using LINQ with Databases |
|
|
700 | (1) |
|
Installing SQL Server and the Northwind Sample Data |
|
|
700 | (1) |
|
Installing SQL Server Express |
|
|
701 | (1) |
|
Installing the Northwind Sample Database |
|
|
701 | (1) |
|
First LINQ to Database Query |
|
|
701 | (3) |
|
Navigating Database Relationships |
|
|
704 | (2) |
|
|
706 | (1) |
|
LINQ to XML Functional Constructors |
|
|
707 | (3) |
|
Constructing XML Element Text with Strings |
|
|
710 | (1) |
|
Saving and Loading an XML Document |
|
|
710 | (3) |
|
Loading XML from a String |
|
|
712 | (1) |
|
Contents of a Saved XML Document |
|
|
713 | (1) |
|
Working with XML Fragments |
|
|
713 | (2) |
|
Generating XML from Databases |
|
|
715 | (2) |
|
How to Query an XML Document |
|
|
717 | (1) |
|
Using LINQ to XML Query Members |
|
|
718 | (5) |
|
|
718 | (1) |
|
|
719 | (2) |
|
|
721 | (2) |
|
|
723 | (4) |
|
PART V ADDITIONAL TECHNIQUES |
|
|
|
Chapter 25 Windows Communication Foundation |
|
|
727 | (32) |
|
|
728 | (1) |
|
|
728 | (5) |
|
WCF Communication Protocols |
|
|
729 | (1) |
|
Addresses, Endpoints, and Bindings |
|
|
729 | (2) |
|
|
731 | (1) |
|
|
732 | (1) |
|
|
732 | (1) |
|
|
732 | (1) |
|
|
733 | (23) |
|
|
740 | (2) |
|
Defining WCF Service Contracts |
|
|
742 | (1) |
|
|
743 | (1) |
|
|
743 | (1) |
|
|
744 | (1) |
|
|
745 | (1) |
|
|
745 | (5) |
|
|
750 | (6) |
|
|
756 | (3) |
|
Chapter 26 Windows Workflow Foundation |
|
|
759 | (20) |
|
|
759 | (2) |
|
|
761 | (2) |
|
|
761 | (1) |
|
|
762 | (1) |
|
|
762 | (1) |
|
|
763 | (4) |
|
|
767 | (9) |
|
|
769 | (4) |
|
|
773 | (1) |
|
|
774 | (2) |
|
|
776 | (3) |
Appendix A Exercise Solutions |
|
779 | (48) |
Index |
|
827 | |