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