| |
| |
Acknowledgments | |
| |
| |
Introduction | |
| |
| |
| |
The .NET Environment and C# | |
| |
| |
| |
Introduction to C# and .NET | |
| |
| |
When to Use C# and C++ | |
| |
| |
Distinguishing .NET from Other Environments | |
| |
| |
Using the Common Language Runtime | |
| |
| |
Viewing Intermediate Language Code | |
| |
| |
Taking Advantage of Just-In-Time Debugging | |
| |
| |
Exploiting the .NET Interoperability with COM | |
| |
| |
Using .NET Versioning to Handle Software Updates | |
| |
| |
Querying Class Capabilities Through .NET Reflection | |
| |
| |
| |
Developing C# Applications Within Visual Studio .NET | |
| |
| |
Using the Visual Studio Options Dialog Box | |
| |
| |
Customizing Toolbars and Menus | |
| |
| |
Adding Items to the Tools Menu | |
| |
| |
Test Driving Visual Studio .NET | |
| |
| |
Using the Properties Tool Window | |
| |
| |
Using IntelliSense | |
| |
| |
Getting Help | |
| |
| |
| |
The C# Language | |
| |
| |
| |
Getting Started with C# | |
| |
| |
Accessing C# Library Classes | |
| |
| |
Creating a Command Line Program | |
| |
| |
Adding References to a Command Line Program | |
| |
| |
Comparing the Results with C++ | |
| |
| |
Creating a Windows Program | |
| |
| |
Comparing the Results with Visual Basic | |
| |
| |
Understanding White Space and Tokens | |
| |
| |
Commenting Your Code | |
| |
| |
Documenting Your Code with XML Comments | |
| |
| |
Using the C# Debugger | |
| |
| |
Using the Output and Task List Windows | |
| |
| |
Deciphering the Task List Window | |
| |
| |
Writing and Using Your Own Namespaces | |
| |
| |
Using the Console Class | |
| |
| |
Formatting Output and Strings | |
| |
| |
Using Preprocessor Directives | |
| |
| |
| |
Laying a C# Foundation | |
| |
| |
Understanding Value Types | |
| |
| |
Understanding References | |
| |
| |
Writing Expressions | |
| |
| |
Writing Statements | |
| |
| |
Using Managed Code | |
| |
| |
Using Logical Operators | |
| |
| |
Using Relational, Equality, and Conditional Operators | |
| |
| |
Using Assignment Operators | |
| |
| |
Understanding C# Type Operators | |
| |
| |
Using unsafe Code | |
| |
| |
Using the sizeof Operator | |
| |
| |
Boxing and Unboxing | |
| |
| |
Using checked and unchecked Statements | |
| |
| |
Writing Loops | |
| |
| |
Using Program Control Statements | |
| |
| |
Understanding Scope in C# | |
| |
| |
| |
Data Types in C# | |
| |
| |
Defining Structures Within C# | |
| |
| |
Declaring and Using Simple Data Types | |
| |
| |
Creating Enumerated Lists | |
| |
| |
Using Reference Types | |
| |
| |
Basics of C# Classes | |
| |
| |
Declaring Arrays in C# | |
| |
| |
Understanding Interfaces | |
| |
| |
Using Delegates to Create a Callback Function | |
| |
| |
Using the object Data Type | |
| |
| |
Passing Variables to Functions | |
| |
| |
Using Fields and Properties | |
| |
| |
Using String Interning to Reduce Memory Consumption | |
| |
| |
Encoding Strings in C# | |
| |
| |
Data Conversion in C# | |
| |
| |
| |
Structures in C# | |
| |
| |
Defining Structures | |
| |
| |
Using Structures as Value-Type Objects | |
| |
| |
Using Structures as References | |
| |
| |
Adding Functions to Structures | |
| |
| |
Adding Properties to a Structure | |
| |
| |
| |
Understanding C# Classes | |
| |
| |
Taking Advantage of Built-In Classes | |
| |
| |
Referring to the Current Object Using the this Keyword | |
| |
| |
Protecting Class Members Using Access Keywords | |
| |
| |
Using Class Member Methods and Properties | |
| |
| |
Using the static Modifier with Class Members | |
| |
| |
Declaring Constructors and Destructors | |
| |
| |
Creating Constants and readonly Fields | |
| |
| |
Nesting One Class Within Another | |
| |
| |
Overloading and Name Hiding | |
| |
| |
| |
Object-Oriented Programming and C# | |
| |
| |
Encapsulating Your Data | |
| |
| |
Inheriting from a Base Class | |
| |
| |
Designing a Base Class | |
| |
| |
Hiding Base Class Members | |
| |
| |
Calling Constructors and Destructors in Order | |
| |
| |
Preventing Inheritance--The Sealed Modifier | |
| |
| |
Polymorphism: Changing Class Behavior Using Virtual Methods | |
| |
| |
Using Virtual Properties | |
| |
| |
Defining an Abstract Class | |
| |
| |
Declaring an Abstract Function | |
| |
| |
Using the Object Browser | |
| |
| |
Setting the Browsing Scope | |
| |
| |
Using the Objects Pane | |
| |
| |
Using the Members Pane | |
| |
| |
Navigating the Object Browser | |
| |
| |
Searching for Symbols | |
| |
| |
| |
Handling Exceptions | |
| |
| |
Using Exception Handling in the CLR | |
| |
| |
Using try and catch Blocks | |
| |
| |
Catching an Exception | |
| |
| |
Using Multiple catch Blocks | |
| |
| |
Using the Exception Classes | |
| |
| |
Throwing an Exception | |
| |
| |
Scope in Exception Blocks | |
| |
| |
Using Exceptions with checked Variables | |
| |
| |
Terminating a Program in an Exception Block | |
| |
| |
Understanding the finally Block | |
| |
| |
| |
Advanced C# Concepts | |
| |
| |
Nesting Namespaces | |
| |
| |
Specifying Namespaces with the using Directive | |
| |
| |
Taking a Closer Look at the using Statement | |
| |
| |
Adding References | |
| |
| |
Building a Module File | |
| |
| |
Creating a Shared Assembly | |
| |
| |
Using C# Interfaces to Define an Abstraction | |
| |
| |
Getting Runtime Information Using Reflection | |
| |
| |
Dynamically Invoking an Object | |
| |
| |
Creating Threads of Execution | |
| |
| |
| |
Using Arrays | |
| |
| |
Initializing an Array | |
| |
| |
Using Multi-Dimensional Arrays | |
| |
| |
Using Jagged Arrays | |
| |
| |
Using the System.Array Class | |
| |
| |
Searching and Sorting Arrays | |
| |
| |
Using the Copy Method to Copy Array Values | |
| |
| |
Using Arrays of Objects | |
| |
| |
Using Indexers | |
| |
| |
How Indexers Work | |
| |
| |
Declaring an Indexer | |
| |
| |
Using the C# Indexer Wizard | |
| |
| |
| |
File Operations | |
| |
| |
Using the FileStream Class | |
| |
| |
Using the MemoryStream Class to Create Temporary Storage | |
| |
| |
Using the NetworkStream Class to Create a Network Connection | |
| |
| |
Using the BufferedStream Class to Buffer a Stream's Input or Output | |
| |
| |
Performing Asynchronous I/O | |
| |
| |
Discarding Unnecessary Data Using the Null Field as a Bit Bucket | |
| |
| |
Exploiting the TextReader and TextWriter Abstract Classes | |
| |
| |
Using StreamReader and StreamWriter | |
| |
| |
Opening a File Using the FileOpen Common Dialog | |
| |
| |
Using the File and FileInfo classes | |
| |
| |
Getting and Setting the Directory | |
| |
| |
| |
Windows Programming in C# | |
| |
| |
| |
Writing Windows Forms Applications | |
| |
| |
Creating a Form-Based Application | |
| |
| |
Hiding and Showing Forms | |
| |
| |
Adding Controls to a Form | |
| |
| |
Adding Forms to an Application | |
| |
| |
Setting the Tab Order | |
| |
| |
Setting Form Properties | |
| |
| |
Using Modal and Modeless Forms | |
| |
| |
| |
Debugging C# Programs | |
| |
| |
Debugging C# and .NET Applications Using DbgCLR.exe | |
| |
| |
Troubleshooting .NET Applications Using Just-In-Time Debugging | |
| |
| |
Running a Program in the Visual Studio Debugger | |
| |
| |
Setting Breakpoints to Suspend a Program's Execution | |
| |
| |
Setting Conditions on Methods | |
| |
| |
Recovering the StackTrace | |
| |
| |
Using the Debug Class | |
| |
| |
Using Trace Listeners | |
| |
| |
Writing Messages to Event Logs | |
| |
| |
| |
Building the User Interface | |
| |
| |
Adding a Menu to a Form | |
| |
| |
Using the Menu Designer | |
| |
| |
Adding Menu Adornments | |
| |
| |
Adding Shortcut Keys (Accelerators) | |
| |
| |
Adding Images | |
| |
| |
Adding a Toolbar | |
| |
| |
Adding a Context Menu | |
| |
| |
Displaying Items in a TreeView Control | |
| |
| |
Displaying Items in a ListView Control | |
| |
| |
An Explorer-Style Application | |
| |
| |
| |
Using Windows Controls | |
| |
| |
Setting Properties for Controls | |
| |
| |
Using Invisible Controls | |
| |
| |
Responding to Control Messages | |
| |
| |
Using One Event for Multiple Controls | |
| |
| |
Enabling and Disabling Controls Using Idle Processing | |
| |
| |
Using the GroupBox Control | |
| |
| |
Grouping Radio Button Controls | |
| |
| |
Anchoring Controls on Forms | |
| |
| |
Docking Controls on Forms | |
| |
| |
| |
Using the Common Dialogs | |
| |
| |
Choosing a Color | |
| |
| |
Selecting a Text Style with FontDialog | |
| |
| |
Opening and Saving Files | |
| |
| |
A Word About Printing | |
| |
| |
Selecting a Printer | |
| |
| |
Setting Page Options | |
| |
| |
Previewing the Print Output | |
| |
| |
| |
Using Events and Delegates | |
| |
| |
Using Events Within C# Programs | |
| |
| |
Writing an Event Handler | |
| |
| |
Sorting Objects Using a Delegate | |
| |
| |
Using a static Delegate | |
| |
| |
Viewing a Delegate's Invocation List | |
| |
| |
Combining and Removing Delegate Methods | |
| |
| |
Responding to Timer Events | |
| |
| |
Responding to System.Threading.Timer Events | |
| |
| |
Index | |