| Contents at a Glance | 5 |
---|
| Contents | 6 |
---|
| About the Author | 13 |
---|
| About the Technical Reviewer | 14 |
---|
| Acknowledgments | 15 |
---|
| Introduction | 16 |
---|
| Application Development | 17 |
---|
| 1-1. Create a Console Application from the Command Line | 18 |
| 1-2. Create a Windows- Based Application from the Command Line | 21 |
| 1-3. Create and Use a Code Module from the Command Line | 24 |
| 1-4. Create and Use a Code Library from the Command Line | 26 |
| 1-5. Embed a Resource File in an Assembly | 27 |
| 1-6. Build Projects from the Command Line Using MSBuild.exe | 30 |
| 1-7. Access Command-Line Arguments | 33 |
| 1-8. Include Code Selectively at Build Time | 35 |
| 1-9. Manipulate the Appearance of the Console | 39 |
| 1-10. Access a Program Element That Has the Same Name As a Keyword | 41 |
| 1-11. Create and Manage Strong-Named Key Pairs | 42 |
| 1-12. Give an Assembly a Strong Name | 43 |
| 1-13. Verify That a Strong-Named Assembly Has Not Been Modified | 46 |
| 1-14. Delay Sign an Assembly | 47 |
| 1-15. Sign an Assembly with an Authenticode Digital Signature | 48 |
| 1-16. Create and Trust a Test Software Publisher Certificate | 53 |
| 1-17. Manage the Global Assembly Cache | 54 |
| 1-18. Make Your Assembly More Difficult to Decompile | 55 |
| 1-19. Use Implicitly Typed Variables | 56 |
| 1-20. Use Object Initializers | 57 |
| 1-21. Use Anonymous Types | 60 |
| 1-22. Create and Use Extension Methods | 61 |
| 1-23. Create and Use Lambda Expressions | 63 |
| Data Manipulation | 67 |
---|
| 2-1. Manipulate the Contents of a String Efficiently | 67 |
| 2-2. Encode a String Using Alternate Character Encoding | 70 |
| 2-3. Convert Basic Value Types to Byte Arrays | 72 |
| 2-4. Base64 Encode Binary Data | 75 |
| 2-5. Validate Input Using Regular Expressions | 78 |
| 2-6. Use Compiled Regular Expressions | 81 |
| 2-7. Create Dates and Times from Strings | 84 |
| 2-8. Add, Subtract, and Compare Dates and Times | 86 |
| 2-9. Convert Dates and Times Across Time Zones | 89 |
| 2-10. Sort an Array or an ArrayList | 93 |
| 2-11. Copy a Collection to an Array | 95 |
| 2-12. Manipulate or Evaluate the Contents of an Array | 96 |
| 2-13. Use a Strongly Typed Collection | 100 |
| 2-14. Create a Generic Type | 102 |
| 2-15. Store a Serializable Object to a File | 105 |
| 2-16. Read User Input from the Console | 108 |
| Application Domains, Reflection, and Metadata | 112 |
---|
| 3-1. Load an Assembly into the Current Application Domain | 113 |
| 3-2. Create an Application Domain | 115 |
| 3-3. Execute an Assembly in a Different Application Domain | 117 |
| 3-4. Avoid Loading Unnecessary Assemblies into Application Domains | 119 |
| 3-5. Create a Type That Cannot Cross Application Domain Boundaries | 120 |
| 3-6. Create a Type That Can Be Passed Across Application Domain Boundaries | 121 |
| 3-7. Instantiate a Type in a Different Application Domain | 124 |
| 3-8. Pass Data Between Application Domains | 128 |
| 3-9. Unload Assemblies and Application Domains | 130 |
| 3-10. Retrieve Type Information | 131 |
| 3-11. Test an Object s Type | 134 |
| 3-12. Instantiate an Object Using Reflection | 136 |
| 3-13. Create a Custom Attribute | 139 |
| 3-14. Inspect the Attributes of a Program Element Using Reflection | 142 |
| Threads, Processes, and Synchronization | 144 |
---|
| 4-1. Execute a Method Using the Thread Pool | 145 |
| 4-2. Execute a Method Asynchronously | 148 |
| 4-3. Creating an Asynchronous Method to Update the User Interface | 155 |
| 4-4. Execute a Method Periodically | 160 |
| 4-5. Execute a Method at a Specific Time | 162 |
| 4-6. Execute a Method by Signaling a WaitHandle Object | 165 |
| 4-7. Execute a Method Using a New Thread | 167 |
| 4-8
|