Preface
I Hello, C#
1.1 A First C# Program
1.2 Namespaces
1.3 Alternative Forms of the Main() Function
1.4 Making a Statement
1.5 Opening a Text File for Reading and Writing
1.6 Formatting Output
1.7 The string Type
1.8 Local Objects
1.9 Value and Reference Types
1.10 The C# Array
1.11 The new Expression
1.12 Garbage Collection
1.13 Dynamic Arrays: The arrayList Collection Class
1.14 The Unified Type System
1.14.1 Shadow Boxing
1.14.2 Unboxing Leaves Us Downcast
1.15 Jagged Arrays
1.16 The Hashtable Container
1.17 Exception Handling
1.18 A Basic Language Handbook for C#
1.18.1 Keywords
1.18.2 Bu#t-in Numeric Types
1.18.3 Arithmetic, Relational, and Conditional Operators
1.18.4 Operator Precedence
1.18.5 Statements
2 Class Design
2.1 Our First Independent Class
2.2 Opening a New Visual Studio Project
2.3 Declaring Data Members
2.4 Properties
2.5 Indexers
2,6 Member Initialization
2.7 The Class Constructor
2.8 The Implicit this Reference
2.9 static Class Members
2.10 const and readonly Data Members
2.11 The enum Value Type
2.12 The delegate Type
2.13 Function Parameter Semantics
2.13.1 Pass by Value
2.13.2 Pass by Reference: The :ef Parameter
2.13.3 Pass by Reference: The out Parameter
2.14 Function Overloading
2.14.1 Resolving Overload Functions
2.14.2 Determining a Best Match
2.15 Variable-Length Parameter Lists
2.16 Operator Overloading
2.17 Conversion Operators
2.18 The Class Destructor
2.19 The struct Value Type
3 Object-Oriented Programming
3.1 Object-Oriented Programming Concepts
3.2 Supporting a Polymorphic Query Language
3.3 Designing a Class Hierarchy
3.4 Object Lessons
3.5 Designing an Abstract Base Class
3.6 Declaring an Abstract Base Class
3.7 Static Members of an Abstract Base Class
3.8 A Hybrid Abstract Base Class
3.8.1 The Single-Inheritance Object Model
3.8.2 How Is a Hybrid Abstract Class Different?
3.9 Defining a Derived Class
3.10 Overriding the Inherited Virtual Interface
3.11 Overriding the Virtual Object Methods
3.12 Member Access: The new and base Modifiers
3.12.1 Accessibility versus Visibility
3.12.2 Encapsulating Base-Class Access
3.13 Sealing a Class
3.14 The Exception Class Hierarchy
4 Interface Inheritance
4.1 Implementing a System Interface: IComparable
4.2 Accessing an Existing Interface
4.3 Defining an Interface
4.3.1 Implementing Our Interface: Proof of Concept
4.3.2 Integrating Our Interface within the System Framework
4.4 Explicit Interface Member Implementations
4.5 Inherited Interface Members
4.6 Overloaded, Hidden, or Ambiguous?
4.7 Mastering Copy Semantics: ICloneable
4.8 Mastering Finalize Semantics: IDisposable
4.9 8itVector: Extension through Composition
5 Exploring the System Namespace
5.1 Supporting the Fundamental Types
5.2 The Array Is a System.Array
5.3 Queuing the Environment
5.3.1 The Environment Class
5.3.2 Accessing All the Environment Variables
5.3.3 The Process Class
5.3.4 Finding the Logical Drives
5.4 System. IO
5.4.1 Handling File Extensions: The Path Class
5.4.2 Manipulating Directories
5.4.3 Manipulating Files
5.4.4 Reading and Writing Files
5.5 A System Miscellany
5.5.1 The system. Collections. Stack Container
5.5.2 The system. Diagnos tics. TraceListener Class
5.5.3 System. Math
5.5.4 The DateTime Class
5.6 Regular Expressions
5.7 System. Threading
5.8 The Web Request/Response Model
5.9 System. Net. Sockets
5.9.1 The Server-Side TcpListener
5.9.2 The Client-Side TcpClient
5.10 System. Data
5.10.1 The Database Tables
5,10.2 Opening the Database: Selecting a Data Provider
5.10.3 Navigating the DataTable
5.10.4 Setting Up the DataRelation
5.10.5 Selection and Expressions
5.11 System. XML
5.11.1 Getting XML Out of Our Programs
5.11.2 XmlTextReader : The Firehose
5.11.3 Document Object Model
5.1 1.4 System. Xml. Xsl
5.1 1.5 System. xml. XPath
6 Windows Forms Designer
6.1 Our First Windows Forms Program
6.2 Building the GUI
6.3 Implementing the Event Callback Routines
6.3.1 Implementing a TextBox Event
6.3.2 Implementing the Button Events: OK
6.3.3 Implementing the Button Events: Quit
6.4 Inspecting and Generating Control Events
6.4.1 Labels Are Programmable
6.5 Implementing the MessageBox Pop-Up Dialog
6.6 The List Box for Unformatted Output
6.7 Exploring the File Dialog
6.8 A Pocketful of Buttons
6.9 Serving Up Menus
6.10 The DataGrid Control
6.11 Adding a PictureBox Control
7 ASP. NET and Web Forms Designer
7.1 Our First Web Forms Program
7.2 Opening an ASP. NET Web Application Project
7.2.1 Modifying the Document Properties
7.2.2 Adding Controls to the Document:Label
7.3 Adding Pages to a Project
7.4 The HyperLink Control: Linking to Other Pages
7,5 The DataGrid Control
7.6 Understanding the Page Event Life Cycle
7.7 The Data Provider
7.8 Web State Management
7.8.1 Adding a TextBox Control
7.8.2 Adding an ImageButton Control
7.8,3 Adding a ListBox Control
7.9 Managing State: Class Members
7.10 Managing State: The Session Object
7.11 Managing State: The Application Object
7.12 Validation Controls
7.13 Adding a DropDownList Control
7.14 Adding a Group of RadloButton Controls
7.15 Adding a CheckBoxList Control
7.16 Adding Validators to a Control
7.17 Adding a Calendar Control
7.18 Adding an Image Control
7.19 Programming Web Server Controls
8 The Common Language Runtime
8.1 Assemblies
8.2 Runtime Type Reflection
8.3 Modifying the Retrieval through BindingFlags
8.4 Invoking a Method during Runtime
8.5 Delegating the Test to Reflection
8.6 Attributes
8.6.1 The Intrinsic Conditional Attribute
8.6.2 The Intrinsic Serializable Attribute
8.6.3 The Intrinsic Dllimport Attribute
8.7 Implementing Our Own Attribute Class
8.7.1 Positional and Named Parameters
8.7.2 Att ributeUsage
8.8 Runtime Discovery of Attributes Using Reflection
8.9 The Intermediate Language
8.9.1 Examining the Intermediate Language
8.9.2 The ildasm Tool
Index