Acknowledgments |
|
xv | |
Introduction |
|
xvii | |
|
.NET Framework Basic Types |
|
|
1 | (50) |
|
|
1 | (6) |
|
Public and Protected Methods |
|
|
2 | (2) |
|
Value Types and Reference Types |
|
|
4 | (2) |
|
|
6 | (1) |
|
|
7 | (24) |
|
|
7 | (7) |
|
|
14 | (2) |
|
|
16 | (2) |
|
|
18 | (2) |
|
|
20 | (1) |
|
Formatting Numeric Values |
|
|
21 | (3) |
|
|
24 | (3) |
|
|
27 | (1) |
|
|
27 | (2) |
|
|
29 | (2) |
|
|
31 | (7) |
|
|
32 | (1) |
|
|
33 | (1) |
|
Parsing Strings into Numbers |
|
|
34 | (1) |
|
|
35 | (2) |
|
|
37 | (1) |
|
|
38 | (9) |
|
Adding and Subtracting Dates |
|
|
39 | (2) |
|
|
41 | (1) |
|
|
42 | (2) |
|
|
44 | (2) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
47 | (4) |
|
Displaying and Parsing Enum Values |
|
|
48 | (1) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
51 | (30) |
|
Memory Management in the .NET Framework |
|
|
51 | (15) |
|
The Garbage Collection Process |
|
|
51 | (1) |
|
|
52 | (3) |
|
|
55 | (3) |
|
Combining the Dispose and Finalize Methods |
|
|
58 | (2) |
|
A Better Dispose-Finalize Pattern |
|
|
60 | (2) |
|
Finalizers in Derived Classes |
|
|
62 | (1) |
|
A Simplified Approach to Finalization |
|
|
63 | (3) |
|
|
66 | (15) |
|
|
66 | (2) |
|
Garbage Collection and Performance |
|
|
68 | (5) |
|
|
73 | (2) |
|
|
75 | (3) |
|
Garbage Collection on Multiple-CPU Computers |
|
|
78 | (3) |
|
|
81 | (24) |
|
Interfaces and Code Reuse |
|
|
81 | (4) |
|
|
85 | (20) |
|
The IComparable Interface |
|
|
85 | (2) |
|
|
87 | (3) |
|
|
90 | (2) |
|
The IDisposable Interface |
|
|
92 | (2) |
|
Writing Collection Classes |
|
|
94 | (6) |
|
Reusable Enumerable Adapters |
|
|
100 | (5) |
|
|
105 | (42) |
|
|
106 | (4) |
|
|
106 | (2) |
|
The Generics-Based Solution |
|
|
108 | (2) |
|
|
110 | (21) |
|
|
110 | (13) |
|
|
123 | (8) |
|
|
131 | (16) |
|
|
131 | (5) |
|
Support for Math Operators |
|
|
136 | (3) |
|
|
139 | (4) |
|
|
143 | (4) |
|
|
147 | (54) |
|
|
147 | (16) |
|
|
149 | (2) |
|
Clearing, Copying, and Moving Elements |
|
|
151 | (4) |
|
|
155 | (1) |
|
|
156 | (2) |
|
|
158 | (5) |
|
The System.Collections Namespace |
|
|
163 | (21) |
|
The ICollection, IList, and IDictionary Interfaces |
|
|
163 | (1) |
|
|
164 | (4) |
|
|
168 | (4) |
|
|
172 | (3) |
|
|
175 | (4) |
|
Abstract Types for Strong-Typed Collections |
|
|
179 | (5) |
|
|
184 | (17) |
|
|
185 | (4) |
|
The Dictionary Generic Type |
|
|
189 | (2) |
|
The LinkedList Generic Type |
|
|
191 | (3) |
|
Other Generic Collections |
|
|
194 | (3) |
|
The System.Generic.ObjectModel Namespace |
|
|
197 | (4) |
|
|
201 | (42) |
|
Regular Expression Overview |
|
|
202 | (11) |
|
|
202 | (2) |
|
The Regular Expression Language |
|
|
204 | (6) |
|
Regular Expression Options |
|
|
210 | (3) |
|
|
213 | (10) |
|
|
213 | (7) |
|
The MatchCollection and Match Types |
|
|
220 | (1) |
|
|
221 | (1) |
|
The CaptureCollection and Capture Types |
|
|
222 | (1) |
|
Regular Expressions at Work |
|
|
223 | (20) |
|
|
223 | (3) |
|
Searching for Words and Quoted Strings |
|
|
226 | (3) |
|
Validating Strings, Numbers, and Dates |
|
|
229 | (2) |
|
Searching for Nested Tags |
|
|
231 | (2) |
|
|
233 | (2) |
|
Parsing and Evaluating Expressions |
|
|
235 | (4) |
|
Playing with Regular Expressions (Literally) |
|
|
239 | (4) |
|
Files, Directories, and Streams |
|
|
243 | (42) |
|
|
244 | (1) |
|
The Directory and File Types |
|
|
245 | (6) |
|
Enumerating Directories and Files |
|
|
245 | (2) |
|
Manipulating Directories and Files |
|
|
247 | (2) |
|
Reading and Writing Files |
|
|
249 | (2) |
|
The DirectoryInfo and FileInfo Types |
|
|
251 | (2) |
|
|
253 | (1) |
|
The FileSystemWatcher Type |
|
|
254 | (6) |
|
Initializing a FileSystemWatcher Component |
|
|
255 | (1) |
|
|
256 | (3) |
|
|
259 | (1) |
|
Working with Access Control Lists |
|
|
260 | (7) |
|
Account Names and Security Identifiers |
|
|
260 | (1) |
|
The DirectorySecurity and FileSecurity Types |
|
|
261 | (4) |
|
|
265 | (2) |
|
|
267 | (7) |
|
|
267 | (2) |
|
Stream Readers and Writers |
|
|
269 | (1) |
|
Reading and Writing Text Files |
|
|
269 | (4) |
|
Reading and Writing Binary Files |
|
|
273 | (1) |
|
|
274 | (11) |
|
|
274 | (2) |
|
|
276 | (1) |
|
|
276 | (4) |
|
|
280 | (1) |
|
|
281 | (4) |
|
|
285 | (50) |
|
|
285 | (12) |
|
Private and Shared Assemblies |
|
|
286 | (3) |
|
|
289 | (3) |
|
|
292 | (2) |
|
Assembly-Level Attributes |
|
|
294 | (2) |
|
The InternalsVisible To Attribute |
|
|
296 | (1) |
|
|
297 | (7) |
|
The Properties.Settings Object |
|
|
297 | (7) |
|
Resources and Satellite Assemblies |
|
|
304 | (12) |
|
|
304 | (3) |
|
|
307 | (2) |
|
|
309 | (3) |
|
Localized Strong-Typed String Resources |
|
|
312 | (1) |
|
|
313 | (1) |
|
|
314 | (2) |
|
Attributes for Satellite Assemblies |
|
|
316 | (1) |
|
|
316 | (12) |
|
Version Policy in Application Configuration Files |
|
|
317 | (3) |
|
Previously Loaded Assemblies and GAC Searches |
|
|
320 | (1) |
|
|
321 | (1) |
|
|
322 | (2) |
|
The Assembly Binding Log Viewer Utility (FUSLOGVW) |
|
|
324 | (1) |
|
Setting the Runtime Version |
|
|
325 | (1) |
|
The .NET Framework Configuration Tool |
|
|
326 | (2) |
|
|
328 | (7) |
|
|
329 | (2) |
|
|
331 | (1) |
|
|
332 | (1) |
|
|
333 | (2) |
|
|
335 | (66) |
|
Working with Assemblies and Modules |
|
|
336 | (8) |
|
|
336 | (6) |
|
|
342 | (1) |
|
|
343 | (1) |
|
|
344 | (27) |
|
|
344 | (7) |
|
|
351 | (7) |
|
|
358 | (6) |
|
|
364 | (5) |
|
Creating a Custom Object Browser |
|
|
369 | (2) |
|
|
371 | (30) |
|
Creating an Object Dynamically |
|
|
371 | (2) |
|
|
373 | (1) |
|
|
374 | (1) |
|
|
375 | (4) |
|
Creating a Universal Comparer |
|
|
379 | (3) |
|
Dynamic Registration of Event Handlers |
|
|
382 | (6) |
|
Scheduling a Sequence of Actions |
|
|
388 | (5) |
|
|
393 | (3) |
|
Performance Considerations |
|
|
396 | (1) |
|
|
397 | (4) |
|
|
401 | (52) |
|
Introducing Custom Attributes |
|
|
402 | (5) |
|
Building a Custom Attribute Class |
|
|
402 | (3) |
|
Reflecting on a Custom Attribute |
|
|
405 | (2) |
|
A Custom Attribute for CSV Serialization |
|
|
407 | (7) |
|
Building a Benchmark Tool |
|
|
414 | (4) |
|
Writing Plug-ins for Windows Forms Applications |
|
|
418 | (12) |
|
The PluginLibrary Project |
|
|
418 | (5) |
|
The MainApplication and MainApplicationStartup Projects |
|
|
423 | (3) |
|
|
426 | (4) |
|
A Framework for n-Tiered Applications |
|
|
430 | (23) |
|
The DataObjectLibrary Project |
|
|
431 | (7) |
|
|
438 | (3) |
|
|
441 | (2) |
|
|
443 | (10) |
|
|
453 | (58) |
|
|
453 | (15) |
|
|
454 | (1) |
|
|
454 | (2) |
|
Passing Data to and from a Thread |
|
|
456 | (2) |
|
|
458 | (2) |
|
|
460 | (2) |
|
|
462 | (2) |
|
Threads and Unhandled Exceptions |
|
|
464 | (1) |
|
|
465 | (3) |
|
|
468 | (21) |
|
|
468 | (5) |
|
|
473 | (2) |
|
Volatile Read and Write Operations |
|
|
475 | (2) |
|
|
477 | (1) |
|
|
478 | (4) |
|
|
482 | (1) |
|
The ReaderWriterLock Type |
|
|
483 | (2) |
|
|
485 | (1) |
|
The ManualResetEvent, AutoResetEvent, and EventWaitHandle Types |
|
|
486 | (3) |
|
|
489 | (3) |
|
|
489 | (1) |
|
|
490 | (2) |
|
|
492 | (9) |
|
|
492 | (5) |
|
Asynchronous File Operations |
|
|
497 | (2) |
|
Adding Asynchronous Support to Your Types |
|
|
499 | (2) |
|
Threading in Windows Forms Applications |
|
|
501 | (10) |
|
The ISynchronizelnvoke Interface |
|
|
501 | (3) |
|
The BackgroundWorker Component |
|
|
504 | (7) |
|
|
511 | (36) |
|
|
511 | (12) |
|
|
512 | (2) |
|
|
514 | (1) |
|
Creating Serializable Types |
|
|
515 | (2) |
|
|
517 | (1) |
|
|
518 | (2) |
|
|
520 | (1) |
|
Version-Tolerant Serialization (VTS) |
|
|
521 | (2) |
|
|
523 | (24) |
|
The IDeserializationCallback Interface |
|
|
524 | (1) |
|
The ISerializable Interface |
|
|
525 | (7) |
|
Serialization and Deserialization Events |
|
|
532 | (2) |
|
The IObjectReference Interface |
|
|
534 | (3) |
|
The ISerializationSurrogate Interface |
|
|
537 | (3) |
|
Inheriting from a Nonserializable Type |
|
|
540 | (7) |
|
|
547 | (40) |
|
|
548 | (17) |
|
|
548 | (2) |
|
|
550 | (1) |
|
|
551 | (3) |
|
The StructLayout Attribute |
|
|
554 | (1) |
|
The FieldOffset Attribute |
|
|
555 | (4) |
|
Delegates and Callback Procedures |
|
|
559 | (1) |
|
The In and Out Attributes |
|
|
560 | (2) |
|
|
562 | (3) |
|
Calling COM Components from .NET |
|
|
565 | (11) |
|
The Runtime Callable Wrapper |
|
|
565 | (2) |
|
Importing a COM Component with Visual Studio |
|
|
567 | (1) |
|
Using the Imported Interop Assembly |
|
|
568 | (1) |
|
Importing a COM Component with Tlblmp |
|
|
569 | (1) |
|
Primary Interop Assemblies |
|
|
570 | (1) |
|
Registration-Free COM Components |
|
|
571 | (1) |
|
Late Binding and Reflection |
|
|
572 | (1) |
|
|
573 | (2) |
|
|
575 | (1) |
|
Calling .NET Objects from COM |
|
|
576 | (11) |
|
|
576 | (1) |
|
Creating a Sample .NET Component |
|
|
577 | (1) |
|
The RegAsm and TlbExp Tools |
|
|
578 | (1) |
|
|
579 | (2) |
|
Using Attributes to Control the Conversion |
|
|
581 | (4) |
|
|
585 | (1) |
|
Writing COM-Friendly .NET Framework Components |
|
|
585 | (2) |
Index |
|
587 | |