You are previewing C# Language Pocket Reference.
O'Reilly logo
C# Language Pocket Reference

Book Description

C# programmers all have one thing in common -- they're learning a new language. That fact alone brings challenges, frustrations, and constant demands on your patience. And, no matter how good your reference books are, you can't always stop to thumb through hundreds of pages to find the piece of information you need. Your answer is the C# Language Pocket Reference. Concise and easy to use, this handy pocket guide to C# comes from the authors of C# in a Nutshell, and is a must-have quick reference for anyone implementing this new object-oriented language. The C# Language Pocket Reference offers the convenience of a quick reference in a format that will actually fit in your pocket. The book includes a guide to C# language elements, a brief overview of the Framework Class library, a cross-reference for namespaces and assemblies, a list of compiler syntax and switches, a regular expressions reference guide, and more. You'll be surprised at how much information can fit into this slim volume. O'Reilly's Pocket References have become a favorite among programmers everywhere. By providing a wealth of important details in a concise, well-organized format, these handy books deliver just what you need to complete the task at hand. When you've reached a sticking point in your work and need to get to a solution quickly, the new C# Language Pocket Reference is the book you'll want to have.

Table of Contents

  1. C# Language Pocket Reference
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. C# Language Pocket Reference
      1. 1.1. Identifiers and Keywords
      2. 1.2. Fundamental Elements
      3. 1.3. Value and Reference Types
        1. 1.3.1. Value Types
        2. 1.3.2. Reference Types
          1. 1.3.2.1. Value and reference types side-by-side
          2. 1.3.2.2. Boxing and unboxing value types
      4. 1.4. Predefined Types
        1. 1.4.1. Integral Types
          1. 1.4.1.1. Integral conversions
        2. 1.4.2. Floating-Point Types
          1. 1.4.2.1. Floating-point conversions
        3. 1.4.3. Decimal Type
          1. 1.4.3.1. Decimal conversions
        4. 1.4.4. Char Type
          1. 1.4.4.1. Char conversions
        5. 1.4.5. Bool Type
          1. 1.4.5.1. Bool conversions
        6. 1.4.6. Object Type
        7. 1.4.7. String Type
      5. 1.5. Arrays
        1. 1.5.1. Multidimensional Arrays
        2. 1.5.2. Local Field Array Declarations
        3. 1.5.3. Array Length and Rank
        4. 1.5.4. Bounds Checking
        5. 1.5.5. Array Conversions
      6. 1.6. Variables and Parameters
        1. 1.6.1. Definite Assignment
        2. 1.6.2. Default Values
        3. 1.6.3. Parameters
          1. 1.6.3.1. Passing arguments by value
          2. 1.6.3.2. Ref modifier
          3. 1.6.3.3. The out modifier
          4. 1.6.3.4. The params modifier
      7. 1.7. Expressions and Operators
        1. 1.7.1. Operator Precedence
        2. 1.7.2. Arithmetic Overflow Check Operators
      8. 1.8. Statements
        1. 1.8.1. Expression Statements
        2. 1.8.2. Declaration Statements
        3. 1.8.3. Selection Statements
          1. 1.8.3.1. The if-else statement
          2. 1.8.3.2. The switch statement
        4. 1.8.4. Loop Statements
          1. 1.8.4.1. while loops
          2. 1.8.4.2. do-while loops
          3. 1.8.4.3. for loops
          4. 1.8.4.4. foreach loops
        5. 1.8.5. Jump Statements
          1. 1.8.5.1. The break statement
          2. 1.8.5.2. The continue statement
          3. 1.8.5.3. The goto statement
          4. 1.8.5.4. The return statement
          5. 1.8.5.5. The throw statement
          6. 1.8.5.6. The lock statement
          7. 1.8.5.7. The using statement
      9. 1.9. Namespaces
        1. 1.9.1. Files
        2. 1.9.2. Using Namespaces
          1. 1.9.2.1. Nesting namespaces
          2. 1.9.2.2. Using a type with its fully qualified name
          3. 1.9.2.3. The using keyword
          4. 1.9.2.4. Aliasing types and namespaces
          5. 1.9.2.5. Global namespace
      10. 1.10. Classes
        1. 1.10.1. The this Keyword
        2. 1.10.2. Fields
          1. 1.10.2.1. Nonstatic fields
          2. 1.10.2.2. The readonly modifier
        3. 1.10.3. Constants
        4. 1.10.4. Properties
        5. 1.10.5. Indexers
        6. 1.10.6. Methods
          1. 1.10.6.1. Signatures
          2. 1.10.6.2. Overloading methods
        7. 1.10.7. Instance Constructors
          1. 1.10.7.1. Field initialization order
          2. 1.10.7.2. Constructor access modifiers
        8. 1.10.8. Static Constructors
          1. 1.10.8.1. Static field initialization order
          2. 1.10.8.2. Nondeterminism of static constructors
        9. 1.10.9. Destructors and Finalizers
        10. 1.10.10. Nested Types
      11. 1.11. Access Modifiers
        1. 1.11.1. Restrictions on Access Modifiers
      12. 1.12. Structs
      13. 1.13. Interfaces
        1. 1.13.1. Defining an Interface
        2. 1.13.2. Implementing an Interface
        3. 1.13.3. Using an Interface
        4. 1.13.4. Extending an Interface
        5. 1.13.5. Explicit Interface Implementation
        6. 1.13.6. Reimplementing an Interface
        7. 1.13.7. Interface Conversions
      14. 1.14. Enums
        1. 1.14.1. Enum Operators
        2. 1.14.2. Enum Conversions
      15. 1.15. Delegates
        1. 1.15.1. Multicast Delegates
      16. 1.16. Events
        1. 1.16.1. Defining a Delegate for an Event
        2. 1.16.2. Storing Data for an Event with EventArgs
        3. 1.16.3. Declaring and Firing an Event
        4. 1.16.4. Acting on an Event with an Event Handler
        5. 1.16.5. Event Accessors
      17. 1.17. Operator Overloading
        1. 1.17.1. Implementing Value Equality
        2. 1.17.2. Logically Paired Operators
        3. 1.17.3. Custom Implicit and Explicit Conversions
        4. 1.17.4. Indirectly Overloadable Operators
      18. 1.18. Try Statements and Exceptions
        1. 1.18.1. Exceptions
        2. 1.18.2. The catch Clause
          1. 1.18.2.1. Omitting the exception variable
          2. 1.18.2.2. Omitting the catch expression
          3. 1.18.2.3. Specifying multiple catch clauses
        3. 1.18.3. The finally Block
        4. 1.18.4. Key Properties of System.Exception
      19. 1.19. Attributes
        1. 1.19.1. Attribute Classes
        2. 1.19.2. Named and Positional Parameters
        3. 1.19.3. Attribute Targets
        4. 1.19.4. Specifying Multiple Attributes
      20. 1.20. Unsafe Code and Pointers
        1. 1.20.1. Pointer Basics
        2. 1.20.2. Unsafe Code
        3. 1.20.3. The fixed Statement
        4. 1.20.4. The Pointer-to-Member Operator
        5. 1.20.5. The stackalloc Keyword
        6. 1.20.6. Void*
        7. 1.20.7. Pointers to Unmanaged Code
      21. 1.21. Preprocessor Directives
      22. 1.22. Framework Class Library Overview
        1. 1.22.1. Core Types
        2. 1.22.2. Text
        3. 1.22.3. Collections
        4. 1.22.4. Streams and I/O
        5. 1.22.5. Networking
        6. 1.22.6. Threading
        7. 1.22.7. Security
        8. 1.22.8. Reflection and Metadata
        9. 1.22.9. Assemblies
        10. 1.22.10. Serialization
        11. 1.22.11. Remoting
        12. 1.22.12. Web Services
        13. 1.22.13. Data Access
        14. 1.22.14. XML
        15. 1.22.15. Graphics
        16. 1.22.16. Rich Client Applications
        17. 1.22.17. Web-Based Applications
        18. 1.22.18. Globalization
        19. 1.22.19. Configuration
        20. 1.22.20. Advanced Component Services
        21. 1.22.21. Diagnostics and Debugging
        22. 1.22.22. Interoperating with Unmanaged Code
        23. 1.22.23. Compiler and Tool Support
        24. 1.22.24. Runtime Facilities
        25. 1.22.25. Native OS Facilities
      23. 1.23. Namespaces and Assemblies
      24. 1.24. Regular Expressions
      25. 1.25. Format Specifiers
        1. 1.25.1. Picture Format Specifiers
        2. 1.25.2. DateTime Format Specifiers
      26. 1.26. C# Compiler Options
        1. 1.26.1. Synopsis
        2. 1.26.2. Examples
        3. 1.26.3. Options
      27. 1.27. Essential .NET Tools
    3. About the Authors
    4. SPECIAL OFFER: Upgrade this ebook with O’Reilly