About This Book |
|
xv | |
|
Introduction to the .NET Framework |
|
|
1 | (40) |
|
|
1 | (1) |
|
|
1 | (1) |
|
The .NET Framework and the Common Language Runtime |
|
|
2 | (4) |
|
Overview of the .NET Framework |
|
|
2 | (1) |
|
Languages and the .NET Framework |
|
|
2 | (1) |
|
The Structure of a .NET Application |
|
|
3 | (1) |
|
Compilation and Execution of a .NET Application |
|
|
4 | (1) |
|
|
5 | (1) |
|
The .NET Base Class Library |
|
|
6 | (9) |
|
Reference Types and Value Types |
|
|
8 | (1) |
|
Using .NET Framework Types in Your Application |
|
|
9 | (3) |
|
The Imports and Using Statements |
|
|
12 | (1) |
|
Referencing External Libraries |
|
|
13 | (1) |
|
|
14 | (1) |
|
Using Classes and Structures |
|
|
15 | (5) |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
16 | (1) |
|
|
16 | (1) |
|
|
17 | (1) |
|
Instantiating User-Defined Types |
|
|
18 | (1) |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
20 | (7) |
|
|
20 | (1) |
|
|
21 | (1) |
|
|
21 | (1) |
|
|
22 | (3) |
|
Constructors and Destructors |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
27 | (6) |
|
|
27 | (2) |
|
|
29 | (1) |
|
Access Modifiers for Nested Types |
|
|
30 | (1) |
|
|
30 | (2) |
|
|
32 | (1) |
|
|
33 | (3) |
|
|
34 | (1) |
|
|
35 | (1) |
|
Classes and Garbage Collection |
|
|
36 | (5) |
|
|
36 | (1) |
|
|
36 | (1) |
|
Demonstrating Garbage Collection |
|
|
37 | (2) |
|
|
39 | (2) |
|
Creating the User Interface |
|
|
41 | (68) |
|
|
41 | (1) |
|
|
41 | (1) |
|
User Interface Design Principles |
|
|
42 | (6) |
|
Forms, Controls, and Menus |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
45 | (2) |
|
|
47 | (1) |
|
|
48 | (16) |
|
Adding Forms to Your Project |
|
|
48 | (1) |
|
|
49 | (1) |
|
Setting the Start-Up Form |
|
|
50 | (2) |
|
Setting the Start-Up Location |
|
|
52 | (1) |
|
Changing the Appearance of Your Form |
|
|
53 | (1) |
|
BackColor, ForeColor, and Text Properties |
|
|
54 | (1) |
|
Font, Cursor, and BackGroundImage |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
57 | (1) |
|
|
57 | (2) |
|
|
59 | (1) |
|
|
60 | (2) |
|
|
62 | (2) |
|
Using Controls and Components |
|
|
64 | (14) |
|
|
64 | (2) |
|
Setting the Control Tab Order |
|
|
66 | (1) |
|
Controls That Can Contain Other Controls |
|
|
67 | (1) |
|
Docking and Anchoring Controls |
|
|
68 | (3) |
|
Using the Controls Collection |
|
|
71 | (1) |
|
Adding Controls to the Toolbox |
|
|
72 | (1) |
|
Creating Event Handlers for Controls |
|
|
73 | (1) |
|
Interacting with the Mouse |
|
|
74 | (2) |
|
Using Extender Provider Components |
|
|
76 | (1) |
|
|
77 | (1) |
|
|
78 | (9) |
|
Creating Menus During Design |
|
|
78 | (1) |
|
Using the MainMenu Component |
|
|
78 | (2) |
|
|
80 | (1) |
|
Menu Access and Shortcut Keys |
|
|
80 | (1) |
|
|
81 | (1) |
|
|
82 | (1) |
|
Modifying Menus at Run Time |
|
|
82 | (1) |
|
Enabling and Disabling Menu Commands |
|
|
82 | (1) |
|
Displaying Check Marks on Menu Items |
|
|
83 | (1) |
|
Displaying Radio Buttons on Menu Items |
|
|
83 | (1) |
|
Making Menu Items Invisible |
|
|
83 | (1) |
|
|
84 | (1) |
|
Merging Menus at Run Time |
|
|
84 | (1) |
|
Adding Menu Items at Run Time |
|
|
85 | (1) |
|
|
86 | (1) |
|
|
87 | (12) |
|
|
87 | (1) |
|
Using Events in Field-Level Validation |
|
|
88 | (3) |
|
|
91 | (2) |
|
|
93 | (2) |
|
|
95 | (3) |
|
|
98 | (1) |
|
The Virtual Doughnut Factory |
|
|
99 | (10) |
|
|
99 | (1) |
|
Creating the User Interface |
|
|
99 | (4) |
|
|
103 | (1) |
|
Creating Validation Handlers |
|
|
104 | (3) |
|
|
107 | (2) |
|
|
109 | (62) |
|
|
109 | (1) |
|
|
109 | (1) |
|
|
110 | (10) |
|
|
110 | (3) |
|
|
113 | (3) |
|
Using Data Type Functionality |
|
|
116 | (3) |
|
|
119 | (1) |
|
Using Constants, Enums, Arrays, and Collections |
|
|
120 | (14) |
|
Constants and Enumerations |
|
|
120 | (4) |
|
|
124 | (2) |
|
|
126 | (2) |
|
|
128 | (3) |
|
Enumerating the Members of an Array or a Collection |
|
|
131 | (2) |
|
|
133 | (1) |
|
|
134 | (10) |
|
|
134 | (3) |
|
Read-Only and Write-Only Properties |
|
|
137 | (1) |
|
|
138 | (1) |
|
Default Properties and Indexers |
|
|
139 | (1) |
|
|
140 | (2) |
|
|
142 | (2) |
|
Implementing Delegates and Events |
|
|
144 | (8) |
|
|
144 | (2) |
|
Declaring and Raising Events |
|
|
146 | (1) |
|
Implementing Event Handlers |
|
|
147 | (2) |
|
Event Handlers That Handle Multiple Events |
|
|
149 | (1) |
|
Events with Multiple Handlers |
|
|
149 | (1) |
|
Removing Handlers at Run Time |
|
|
150 | (1) |
|
|
151 | (1) |
|
Adding Components and Implementing Members |
|
|
152 | (12) |
|
|
152 | (1) |
|
Creating the DoughnutMachine Component |
|
|
152 | (7) |
|
Adding the DoughnutMachine to the User Interface |
|
|
159 | (5) |
|
|
164 | (7) |
|
|
164 | (1) |
|
Creating the Fraction Class |
|
|
164 | (3) |
|
Testing the Fraction Class |
|
|
167 | (3) |
|
|
170 | (1) |
|
Object-Oriented Programming and Polymorphism |
|
|
171 | (46) |
|
|
171 | (1) |
|
|
171 | (1) |
|
Introduction to Object-Oriented Programming |
|
|
172 | (5) |
|
Objects, Members, and Abstraction |
|
|
172 | (2) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
175 | (2) |
|
|
177 | (5) |
|
Creating Overloading Methods |
|
|
178 | (1) |
|
Overloading Operators with Visual C# |
|
|
179 | (2) |
|
|
181 | (1) |
|
|
182 | (8) |
|
|
182 | (2) |
|
Polymorphism with Interfaces |
|
|
184 | (1) |
|
|
185 | (3) |
|
|
188 | (2) |
|
|
190 | (13) |
|
|
190 | (2) |
|
|
192 | (7) |
|
Abstract Classes and Members |
|
|
199 | (3) |
|
|
202 | (1) |
|
|
203 | (14) |
|
|
203 | (1) |
|
Creating the CompoundFraction Class |
|
|
203 | (5) |
|
Creating Overloaded Operators or Shared Methods |
|
|
208 | (1) |
|
Creating a Strongly Typed Collection Class |
|
|
209 | (6) |
|
|
215 | (2) |
|
Testing and Debugging Your Application |
|
|
217 | (52) |
|
|
217 | (1) |
|
|
217 | (1) |
|
Using the Debugging Tools |
|
|
218 | (13) |
|
|
218 | (2) |
|
|
220 | (3) |
|
|
223 | (2) |
|
Breakpoint Properties and Setting Breakpoint Conditions |
|
|
225 | (1) |
|
Using the Debugging Windows |
|
|
226 | (4) |
|
|
230 | (1) |
|
Using the Debug and Trace Classes |
|
|
231 | (10) |
|
|
231 | (1) |
|
Writing Trace and Debug Output |
|
|
232 | (1) |
|
|
233 | (3) |
|
|
236 | (2) |
|
Configuring Trace Switches |
|
|
238 | (2) |
|
|
240 | (1) |
|
Creating a Unit Test Plan |
|
|
241 | (5) |
|
|
241 | (4) |
|
|
245 | (1) |
|
Handling and Throwing Exceptions |
|
|
246 | (10) |
|
How Exceptions Are Handled |
|
|
246 | (1) |
|
Creating an Exception Handler |
|
|
247 | (4) |
|
|
251 | (4) |
|
|
255 | (1) |
|
|
256 | (4) |
|
|
256 | (1) |
|
Identifying Syntax Errors |
|
|
256 | (1) |
|
Identifying Run-Time Errors |
|
|
257 | (1) |
|
Identifying Logical Errors |
|
|
258 | (2) |
|
Creating, Throwing, and Handling Exceptions |
|
|
260 | (4) |
|
|
260 | (1) |
|
Creating the MyDivideByZeroException class |
|
|
260 | (1) |
|
|
261 | (1) |
|
|
262 | (2) |
|
|
264 | (5) |
|
|
264 | (1) |
|
Adding Trace Functionality |
|
|
264 | (1) |
|
Creating a .config File and Testing Tracing |
|
|
265 | (2) |
|
|
267 | (2) |
|
Data Access Using ADO.NET |
|
|
269 | (90) |
|
|
269 | (1) |
|
|
269 | (1) |
|
|
270 | (5) |
|
Disconnected Database Access |
|
|
270 | (1) |
|
ADO.NET Data Architecture |
|
|
271 | (3) |
|
|
274 | (1) |
|
Overview of Structured Query Language |
|
|
275 | (6) |
|
|
275 | (3) |
|
|
278 | (1) |
|
|
278 | (1) |
|
The Insert Into Statement |
|
|
279 | (1) |
|
|
279 | (2) |
|
|
281 | (25) |
|
|
281 | (3) |
|
|
284 | (6) |
|
|
290 | (7) |
|
Creating and Configuring DataAdapters |
|
|
297 | (3) |
|
Retrieving Data Using DataAdapters |
|
|
300 | (5) |
|
|
305 | (1) |
|
Using DataSet Objects and Updating Data |
|
|
306 | (17) |
|
Creating and Filling DataSet Objects Without a DataAdapter |
|
|
306 | (5) |
|
|
311 | (1) |
|
|
312 | (3) |
|
Editing and Updating Data |
|
|
315 | (7) |
|
|
322 | (1) |
|
Binding, Viewing, and Filtering Data |
|
|
323 | (14) |
|
|
323 | (8) |
|
Filtering and Sorting Data |
|
|
331 | (5) |
|
|
336 | (1) |
|
|
337 | (8) |
|
Retrieving XML from a SQL Server 2000 Database |
|
|
337 | (1) |
|
|
338 | (2) |
|
Using the XmlDataDocument Class |
|
|
340 | (3) |
|
|
343 | (2) |
|
Connecting with a Database |
|
|
345 | (9) |
|
|
345 | (1) |
|
Adding Data Access and Using the DataReader |
|
|
345 | (2) |
|
Retrieving and Updating Data Using DataAdapter Objects and a DataSet |
|
|
347 | (2) |
|
Creating a Typed DataSet Using the XML Designer |
|
|
349 | (2) |
|
Using the Data Form Wizard |
|
|
351 | (3) |
|
Connecting with an XML Data Store |
|
|
354 | (5) |
|
|
354 | (1) |
|
Accessing the XML Data Store |
|
|
354 | (3) |
|
|
357 | (2) |
|
Creating Controls Using the .NET Framework |
|
|
359 | (42) |
|
|
359 | (1) |
|
|
359 | (1) |
|
|
360 | (14) |
|
The System.Drawing Namespaces |
|
|
360 | (1) |
|
|
361 | (4) |
|
|
365 | (3) |
|
|
368 | (1) |
|
|
369 | (1) |
|
|
370 | (3) |
|
|
373 | (1) |
|
|
374 | (11) |
|
Overview of Control Authoring |
|
|
374 | (3) |
|
Creating an Inherited Control |
|
|
377 | (2) |
|
|
379 | (3) |
|
Creating a Custom Control |
|
|
382 | (1) |
|
|
383 | (2) |
|
Common Tasks Using Controls |
|
|
385 | (7) |
|
Adding Your Control to the Toolbox |
|
|
385 | (1) |
|
Providing a Toolbox Bitmap for Your Control |
|
|
386 | (1) |
|
|
387 | (1) |
|
Managing Control Licensing |
|
|
388 | (2) |
|
Hosting Your Control in Internet Explorer |
|
|
390 | (1) |
|
|
391 | (1) |
|
Creating a Custom Control |
|
|
392 | (9) |
|
|
392 | (1) |
|
|
392 | (5) |
|
|
397 | (2) |
|
|
399 | (2) |
|
Advanced .NET Framework Topics |
|
|
401 | (54) |
|
|
401 | (1) |
|
|
401 | (1) |
|
Implementing Print Functionality |
|
|
402 | (15) |
|
The PrintDocument Component |
|
|
402 | (3) |
|
|
405 | (6) |
|
Using PrintPreviewControl |
|
|
411 | (1) |
|
|
412 | (3) |
|
|
415 | (2) |
|
Accessing and Invoking Components |
|
|
417 | (10) |
|
Accessing .NET and COM Type Libraries |
|
|
417 | (2) |
|
Instantiating ActiveX Controls |
|
|
419 | (1) |
|
|
419 | (5) |
|
Accessing the Windows API |
|
|
424 | (1) |
|
|
425 | (2) |
|
Implementing Accessibility |
|
|
427 | (4) |
|
|
427 | (1) |
|
Accessibility and the Certified for Windows Program |
|
|
428 | (1) |
|
Accessibility Properties of Windows Forms Controls |
|
|
429 | (1) |
|
|
430 | (1) |
|
Implementing Help in Your Application |
|
|
431 | (3) |
|
|
431 | (1) |
|
The HelpProvider Component |
|
|
432 | (1) |
|
|
433 | (1) |
|
Globalization and Localization |
|
|
434 | (11) |
|
Globalization and Localization |
|
|
434 | (5) |
|
Culture-Specific Formatting |
|
|
439 | (4) |
|
|
443 | (2) |
|
Creating a Localized Form with Print Support |
|
|
445 | (10) |
|
|
445 | (1) |
|
|
445 | (3) |
|
|
448 | (3) |
|
|
451 | (3) |
|
|
454 | (1) |
|
Assemblies, Configuration, and Security |
|
|
455 | (46) |
|
|
455 | (1) |
|
|
455 | (1) |
|
|
456 | (13) |
|
|
456 | (2) |
|
Resources and Resource Assemblies |
|
|
458 | (7) |
|
|
465 | (2) |
|
|
467 | (2) |
|
Configuring and Optimizing Your Application |
|
|
469 | (9) |
|
Creating the Configuration File |
|
|
469 | (2) |
|
Configuring Your Application Using Dynamic Properties |
|
|
471 | (4) |
|
Optimizing Your Application's Performance |
|
|
475 | (2) |
|
|
477 | (1) |
|
Securing Your Application |
|
|
478 | (17) |
|
|
479 | (1) |
|
Configuring Role-Based Authorization |
|
|
479 | (5) |
|
Configuring Code Access Security |
|
|
484 | (6) |
|
Using Exception Handling with Imperative Security |
|
|
490 | (1) |
|
Configuring Network and Machine Code Access Security Policy |
|
|
491 | (3) |
|
|
494 | (1) |
|
Configuring and Securing an Application |
|
|
495 | (6) |
|
|
495 | (1) |
|
Adding the Configuration File |
|
|
495 | (2) |
|
Securing Your Application |
|
|
497 | (3) |
|
|
500 | (1) |
|
Deploying Your Application |
|
|
501 | (34) |
|
|
501 | (1) |
|
|
501 | (1) |
|
Planning the Deployment of Your Project |
|
|
502 | (13) |
|
|
502 | (1) |
|
|
503 | (4) |
|
Configuring Build Properties of Your Setup Project |
|
|
507 | (4) |
|
Building, Distributing, and Deploying a Setup Project |
|
|
511 | (3) |
|
|
514 | (1) |
|
Configuring Your Setup Project |
|
|
515 | (16) |
|
Setting the Setup Project Properties |
|
|
515 | (2) |
|
|
517 | (12) |
|
Installing a Native Assembly Image |
|
|
529 | (1) |
|
Verifying Installed Assembly Security Policies |
|
|
529 | (1) |
|
|
530 | (1) |
|
Creating an Installer Application |
|
|
531 | (4) |
|
|
531 | (1) |
|
Creating the Setup Project |
|
|
531 | (1) |
|
Configuring Your Application |
|
|
532 | (1) |
|
Installing Your Application |
|
|
532 | (2) |
|
|
534 | (1) |
Appendix A Questions and Answers |
|
535 | (14) |
Glossary |
|
549 | (8) |
Index |
|
557 | |