Contents Listing
Acknowledgments
Introduction
PART I BASICS OF THE MICROSOFT .NET FRAMEWORK
1 The Architecture of the .NET Framework Development Platform
Compiling Source Code into Managed Modules
Combining Managed Modules into Assemblies
Loading the Common Language Runtime
Executing Your Assembly's Code
IL and Verification
The .NET Framework Class Library
The Common Type System
The Common Language Specification
Interoperability with Unmanaged Code
2 Building, Packaging, Deploying, and Administering Applications
and Types
.NET Framework Deployment Goals
Building Types into a Module
Combining Modules to Form an Assembly
Adding Assemblies to a Project Using the Visual Studio .NET IDE
Using the Assembly Linker
Including Resource Files in the Assembly
Assembly Version Resource Information
Version Numbers
Culture
Simple Application Deployment (Privately Deployed Assemblies)
Simple Administrative Control (Configuration)
3 Shared Assemblies
Two Kinds of Assemblies, Two Kinds of Deployment
Giving an Assembly a Strong Name
The Global Assembly Cache
The Internal Structure of the GAC
Building an Assembly That References a Strongly Named Assembly
Strongly Named Assemblies Are Tamper-Resistant
Delayed Signing
Privately Deploying Strongly Named Assemblies
Side-by-Side Execution
How the Runtime Resolves Type References
Advanced Administrative Control (Configuration)
Publisher Policy Control
Repairing a Faulty Application
PART II WORKING WITH TYPES AND THE COMMON LANGUAGE RUNTIME
4 Type Fundamentals
All Types Are Derived from System.Object
Casting Between Types
Casting with the C# is and as Operators
Namespaces and Assemblies
5 Primitive, Reference, and Value Types
Programming Language Primitive Types
Checked and Unchecked Primitive Type Operations
Reference Types and Values Types
Boxing and Unboxing Value Types
6 Common Object Operations
Object Equality and Identity
Implementing Equals for a Reference Type Whose Base Classes
Don't Override Object's Equals
Implementing Equals for a Reference Type When One or More of Its
Base Classes Overrides Object's Equals
156
Implementing Equals for a Value Type
Summary of Implementing Equals and the ==/!= Operators
Identity
Object Hash Codes
Object Cloning
PART III DESIGNING TYPES
7 Type Members and Their Accessibility
Type Members
Accessibility Modifiers and Predefined Attributes
Type Predefined Attributes
Field Predefined Attributes
Method Predefined Attributes
8 Constants and Fields
Constants
Fields
9 Methods
Instance Constructors
Type Constructors
Operator Overload Methods
Operators and Programming Language Interoperability
Conversion Operator Methods
Passing Parameters by Reference to a Method
Passing a Variable Number of Parameters to a Method
How Virtual Methods Are Called
Virtual Method Versioning
10 Properties
Parameterless Properties
Parameterful Properties
11 Events
Designing a Type That Exposes an Event
Designing a Type That Listens for an Event
Explicitly Controlling Event Registration
Designing a Type That Defines Lots of Events
Designing the EventHandlerSet Type
PART IV ESSENTIAL TYPES
12 Working with Text
Characters
The System.String Type
Constructing Strings
Strings Are Immutable
Comparing Strings
String Interning
String Pooling
Examining a String's Characters
Other String Operations
Dynamically Constructing a String Efficiently
Constructing a StringBuilder Object
StringBuilder's Members
Obtaining a String Representation for an Object
Specific Formats and Cultures
Formatting Multiple Objects into a Single String
Providing Your Own Custom Formatter
Parsing a String to Obtain an Object
Encodings: Converting Between Characters and Bytes
Encoding/Decoding Streams of Characters and Bytes
Base-64 String Encoding and Decoding
13 Enumerated Types and Bit Flags
Enumerated Types
Bit Flags
14 Arrays
All Arrays Are Implicitly Derived from System.Array
Casting Arrays
Passing and Returning Arrays
Creating Arrays That Have a Nonzero Lower Bound
Fast Array Access
Redimensioning an Array
15 Interfaces
|