| | Copyright |
| | About the author |
| | Preface |
| | Introduction |
| | | Targeted audience |
| | | Software prerequisites |
| | | What this book covers |
| | | Typographic conventions used |
| | | Codes |
| | | Errata discoveries |
| | | Trademarks |
| | | Structure of the book |
|
| | Acknowledgments |
| | Part 1. Introducing .NET and C# |
| | | Chapter 1. Introducing .NET |
| | | Section 1.1. Evolution: from COM to .NET |
| | | Section 1.2. What exactly is .NET? |
| | | Section 1.3. Multiple .NET programming languages and VS.NET |
| | | Section 1.4. Intermediate language |
| | | Section 1.5. The .NET Common Language Runtime |
| | | Section 1.6. Competing in parallel with Java technologies |
| | | Section 1.7. Common language infrastructure |
| | | Section 1.8. Other .NET- related technologies |
| | | Section 1.9. Unsafe codes and real time programs |
| | | Section 1.10. Porting .NET to other operating systems |
|
| | | Chapter 2. Introducing C# |
| | | Section 2.1. Potent combo of Java and C++ |
|
| | | Chapter 3. JUMP to .NET and J# |
| | | Section 3.1. Java Language Conversion Assistant |
| | | Section 3.2. The J# language |
|
| | | Chapter 4. Hello C#! |
| | | Section 4.1. How to compile and run the code examples in this book |
| | | Section 4.2. Some .NET specifics |
| | | Section 4.3. Disassembling an assembly file |
|
|
| | Part 2. Classes, methods and other OO stuff |
| | | Chapter 5. Getting started |
| | | Section 5.1. Basic class structure |
| | | Section 5.2. Basic console I/O |
| | | Section 5.3. C# namespaces (Java packages) |
|
| | | Chapter 6. Class issues |
| | | Section 6.1. Class modifiers |
| | | Section 6.2. Class members |
| | | Section 6.3. Creating an object with the new operator |
| | | Section 6.4. Looking at System.Object |
| | | Section 6.5. Class inheritance |
| | | Section 6.6. Implementing interfaces |
| | | Section 6.7. Sealed classes (Java final classes) |
| | | Section 6.8. Abstract classes |
| | | Section 6.9. Nested classes (Java inner classes) |
|
| | | Chapter 7. Method issues |
| | | Section 7.1. Method modifiers |
| | | Section 7.2. Method basics |
| | | Section 7.3. Instance constructors |
| | | Section 7.4. Static constructors (Java static initializers) |
| | | Section 7.5. Destructors |
| | | Section 7.6. Constructor initializers and constructor chaining |
| | | Section 7.7. Method overloading |
| | | Section 7.8. Passing variable numbers of parameters into C# methods |
| | | Section 7.9. Abstract methods |
| | | Section 7.10. Method overriding using the virtual and override Modifiers |
| | | Section 7.11. Method hiding with the new keyword |
| | | Section 7.12. Static methods |
| | | Section 7.13. Sealed methods (Java final methods) |
|
| | | Chapter 8. Miscellaneous issues |
| | | Section 8.1. Access modifiers |
| | | Section 8.2. Static members |
| | | Section 8.3. C# constants and read-only fields (Java final variables ) |
| | | Section 8.4. Volatile fields |
|
|
| | Part 3. Types, operators, and flow control |
| | | Chapter 9. C# types |
| | | Section 9.1. Pointer types |
| | | Section 9.2. Reference types |
| | | Section 9.3. Value types |
| | | Section 9.4. Unsigned types in C# |
| | | Section 9.5. The decimal type |
| | | Section 9.6. The char type |
| | | Section 9.7. The string type and string literals |
| | | Section 9.8. All types are objects |
| | | Section 9.9. Casting for reference types |
| | | Section 9.10. Casting for value types |
| | | Section 9.11. Common typing with other .NET languages |
|
| | | Chapter 10. C# operators |
| | | Section 10.1. Operators and their precedence in C# |
| | | Section 10.2. Operator overloading |
| | | Section 10.3. typeof operator |
| | | Section 10.4. checked and unchecked operators and statements |
| | | Section 10.5. The == operator |
| | | Section 10.6. The is operator (Java's instanceof operator) |
| | | Section 10.7. The as operator |
|
| | | Chapter 11. Iteration and flow control |
| | | Section 11.1. Looping with the while , do , for , continue and break keywords |
| | | Section 11.2. Conditional statements using the if and else keywords |
| | | Section 11.3. Looping with the foreach keyword |
| | | Section 11.4. Conditional statements with the switch and case keywords |
| | | Section 11.5. Flow control with the break and continue keywords |
| | | Section 11.6. Flow control with the goto keyword |
|
|
| | Part 4. Core topics |
| | | Chapter 12. Arrays |
| | | Section 12.1. One-dimensional arrays |
| | | Section 12.2. Multi-dimensional arrays: rectangular arrays |
| | | Section 12.3. Multi-dimensional arrays: jagged arrays |
| | | Section 12.4. Mixing jagged and rectangular arrays |
| | | Section 12.5. Using the System.Array class |
|
| | | Chapter 13. Exception handling |
| | | Section 13.1. Exception examples |
| | | Section 13.2. C# exception hierarchy |
| | | Section 13.3. Examining System.Exception |
| | | Section 13.4. Inner exceptions |
| | | Section 13.5. Catching generic exceptions |
|
| | | Chapter 14. C# delegates |
| | | Section 14.1. What are delegates? |
| | | Section 14.2. A first delegate example |
| | | Section 14.3. Combining delegates |
| | | Section 14.4. Removing delegates |
| | | Section 14.5. Exception throwing in delegates |
| | | Section 14.6. Passing method parameters by reference in delegates |
|
| | | Chapter 15. C# events |
| | | Section 15.1. Generic event model |
| | | Section 15.2. What are C# events? |
| | | Section 15.3. A full example |
| | | Section 15.4. Another full example |
|
| | | Chapter 16. Reflection and dynamic method invocation |
| | | Section 16.1. Retrieving the type of an instance |
| | | Section 16.2. Retrieving the type from a name of a class |
| | | Section 16.3. Retrieving methods from a type |
| | | Section 16.4. Retrieving modules from an assembly |
| | | Section 16.5. Dynamically invoking methods in late bound objects |
| | | Section 16.6. Creating new types during runtime |
|
| | | Chapter 17. Multi-threaded programming |
| | | Section 17.1. Multi-threading |
| | | Section 17.2. Thread states and multi-threading in C# |
| | | Section 17.3. Thread synchronization |
| | | Section 17.4. Threading guidelines |
|
| | | Chapter 18. File I/O |
| | | Section 18.1. Copying, moving, and deleting files |
| | | Section 18.2. Copying, moving, and deleting directories |
| | | Section 18.3. Reading from or writing to a binary file |
| | | Section 18.4. Reading from and writing to text files |
|
| | | Chapter 19. C# collection classes |
| | | Section 19.1. ArrayList |
| | | Section 19.2. BitArray |
| | | Section 19.3. Hashtable |
| | | Section 19.4. Queue |
| | | Section 19.5. SortedList |
| | | Section 19.6. Stack |
|
|
| | Part 5. Convenience features |
| | | Chapter 20. C# properties |
| | | Section 20.1. Properties as a replacement for accessor and mutator methods |
| | | Section 20.2. Having only either the get or set section |
| | | Section 20.3. Inheritance of properties |
|
| | | Chapter 21. C# indexes |
| | | Section 21.1. Overloading indexers |
| | | Section 21.2. Wrong use of indexers |
|
| | | Chapter 22. Operator overloading |
| | | Section 22.1. Explaining operator overloading |
| | | Section 22.2. Operator overloading proper |
| | | Section 22.3. Another example of operator overloading |
|
| | | Chapter 23. User -defined conversions/casts |
| | | Section 23.1. The implicit and explicit keywords |
| | | Section 23.2. Syntax of user-defined conversion method declarations |
|
|
| | Part 6. C#-specific features |
| | | Chapter 24. C# preprocessor directives |
| | | Section 24.1. Conditional compilation With #define , #undef , #if and #endif |
| | | Section 24.2. #else and #elif |
| | | Section 24.3. The /define compiler option and #undef |
| | | Section 24.4. #warning and #error |
| | | Section 24.5. #region and #endregion |
|
| | | Chapter 25. Using enums |
| | | Section 25.1. Specifying different int values for enum elements |
|
| | | Chapter 26. C# structures |
| | | Section 26.1. First look at structs |
| | | Section 26.2. Differences between a struct and a class |
| | | Section 26.3. Why use a struct? |
|
| | | Chapter 27. C# attributes |
| | | Section 27.1. First look at attributes |
| | | Section 27.2. Standard attributes |
|
| | | Chapter 28. Writing custom attributes |
| | | Section 28.1. An attribute class |
| | | Section 28.2. Another custom attribute example |
| | | Section 28.3. Naming attribute classes and attribute specifications |
| | | Section 28.4. Custom attributes in depth |
| | | Section 28.5. The AttributeUsage attribute |
|
| | | Chapter 29. Writing unsafe codes |
| | | Section 29.1. Definitions |
| | | Section 29.2. Comparing Java and C#/.NET |
| | | Section 29.3. Introducing pointers |
| | | Section 29.4. Using the unsafe keyword |
| | | Section 29.5. Declaring pointers |
| | | Section 29.6. Using the & address-of operator |
| | | Section 29.7. Using the * Indirection operator |
| | | Section 29.8. Passing pointers to methods |
| | | Section 29.9. Using the -> member access operator |
| | | Section 29.10. Using the sizeof operator |
| | | Section 29.11. Pointer casting |
| | | Section 29.12. Pointer arithmetic |
| | | Section 29.13. Using the fixed keyword |
| | | Section 29.14. A further example |
|
|
| | Part 7. Appendices |
| | | Appendix A. Keywords in C# |
| | | Appendix B. Comparing Java and C# keywords |
| | | Appendix C. C# coding conventions |
| | | Section C.1. General naming conventions |
| | | Section C.2. Naming C# events |
| | | Section C.3. Naming C# enums |
| | | Section C.4. Naming C# interfaces |
| | | Section C.5. Naming C# properties |
| | | Section C.6. Naming namespaces |
| | | Section C.7. Language interoperability issues |
|
| | | Appendix D. XML documentation |
| | | Appendix E. C# command line tools |
| | | Appendix F. About .NET assemblies |
| | | Section F.1. What is an assembly? |
| | | Section F.2. Shared assemblies and the GAC |
| | | Section F.3. What is DLL hell? |
| | | Section F.4. Creating DLL assemblies using csc.exe |
| | | Section F.5. Compiling to modules |
| | | Section F.6. Referencing an external module during compilation of an assembly |
|
| | | Appendix G. Abbreviations used in this book |
|