Book description
The first edition of this book was released at the 2001 Tech Ed conference in Atlanta, Georgia. Since that time, this text has been revised, tweaked, and enhanced to account for the changes found within each release of the .NET platform (1.1, 2.0, 3.0 and now 3.5).
.NET 3.0 was more of an augmentative release, essentially providing three new APIs: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF). As you would expect, coverage of the "W's" has been expanded a great deal in this version of the book from the previous Special Edition text.
Unlike .NET 3.0, .NET 3.5 provides dozens of C# language features and .NET APIs. This edition of the book will walk you through all of this material using the same readable approach as was found in previous editions. Rest assured, you'll find detailed coverage of Language Integrated Query (LINQ), the C# 2008 language changes (automatic properties, extension methods, anonymous types, etc.) and the numerous bells and whistles of Visual Studio 2008.
Table of contents
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
-
I. Introducing C# and the .NET Platform
-
1. The Philosophy of .NET
- Understanding the Previous State of Affairs
- The .NET Solution
- Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS)
- Additional .NET-Aware Programming Languages
- An Overview of .NET Assemblies
- Understanding the Common Type System
- Understanding the Common Language Specification
- Understanding the Common Language Runtime
- The Assembly/Namespace/Type Distinction
- Exploring an Assembly Using ildasm.exe
- Exploring an Assembly Using Lutz Roeder's Reflector
- Deploying the .NET Runtime
- The Platform-Independent Nature of .NET
- Summary
-
2. Building C# Applications
- The Role of the .NET Framework 3.5 SDK
- Building C# Applications Using csc.exe
- Building .NET Applications Using TextPad
- Building .NET Applications Using Notepad++
- Building .NET Applications Using SharpDevelop
- Building .NET Applications Using Visual C# 2008 Express
- Building .NET Applications Using Visual Studio 2008
- A Partial Catalog of Additional .NET Development Tools
- Summary
-
1. The Philosophy of .NET
-
II. Core C# Programming Constructs
-
3. Core C# Programming Constructs, Part I
- The Anatomy of a Simple C# Program
- An Interesting Aside: Some Additional Members of the System.Environment Class
- The System.Console Class
- System Data Types and C# Shorthand Notation
- Understanding the System.String Type
- Narrowing and Widening Data Type Conversions
- C# Iteration Constructs
- Decision Constructs and the Relational/Equality Operators
- Summary
- 4. Core C# Programming Constructs, Part II
-
5. Defining Encapsulated Class Types
- Introducing the C# Class Type
- Understanding Class Constructors
- The Role of the this Keyword
- Understanding the static Keyword
- Defining the Pillars of OOP
- C# Access Modifiers
- The First Pillar: C#'s Encapsulation Services
- Understanding Constant Data
- Understanding Read-Only Fields
- Understanding Partial Types
- Documenting C# Source Code via XML
- Visualizing the Fruits of Our Labor
- Summary
-
6. Understanding Inheritance and Polymorphism
- The Basic Mechanics of Inheritance
- Revising Visual Studio Class Diagrams
- The Second Pillar: The Details of Inheritance
- Programming for Containment/Delegation
- The Third Pillar: C#'s Polymorphic Support
- Understanding Base Class/Derived Class Casting Rules
- The Master Parent Class: System.Object
- Summary
-
7. Understanding Structured Exception Handling
- Ode to Errors, Bugs, and Exceptions
- The Role of .NET Exception Handling
- The Simplest Possible Example
- Configuring the State of an Exception
- System-Level Exceptions (System.SystemException)
- Application-Level Exceptions (System.ApplicationException)
- Processing Multiple Exceptions
- The Finally Block
- Who Is Throwing What?
- The Result of Unhandled Exceptions
- Debugging Unhandled Exceptions Using Visual Studio
- Summary
- 8. Understanding Object Lifetime
-
3. Core C# Programming Constructs, Part I
-
III. Advanced C# Programming Constructs
-
9. Working with Interfaces
- Understanding Interface Types
- Defining Custom Interfaces
- Implementing an Interface
- Invoking Interface Members at the Object Level
- Interfaces As Parameters
- Interfaces As Return Values
- Arrays of Interface Types
- Implementing Interfaces Using Visual Studio 2008
- Resolving Name Clashes via Explicit Interface Implementation
- Designing Interface Hierarchies
- Building Enumerable Types (IEnumerable and IEnumerator)
- Building Cloneable Objects (ICloneable)
- Building Comparable Objects (IComparable)
- Understanding Callback Interfaces
- Summary
-
10. Collections and Generics
- The Interfaces of the System.Collections Namespace
- The Class Types of System.Collections
- System.Collections.Specialized Namespace
- The Boxing, Unboxing, and System.Object Relationship
- The Issue of Type Safety and Strongly Typed Collections
- The System.Collections.Generic Namespace
- Creating Custom Generic Methods
- Creating Generic Structures and Classes
- Creating a Custom Generic Collection
- Creating Generic Base Classes
- Creating Generic Interfaces
- Summary
-
11. Delegates, Events, and Lambdas
- Understanding the .NET Delegate Type
- Defining a Delegate in C#
- The System.MulticastDelegate and System.Delegate Base Classes
- The Simplest Possible Delegate Example
- Retrofitting the Car Type with Delegates
- A More Elaborate Delegate Example
- Understanding Delegate Covariance
- Creating Generic Delegates
- Understanding C# Events
- The Generic EventHandler<T> Delegate
- Understanding C# Anonymous Methods
- Understanding Method Group Conversions
- The C# 2008 Lambda Operator
- Summary
- 12. Indexers, Operators, and Pointers
- 13. C# 2008 Language Features
- 14. An Introduction to LINQ
-
9. Working with Interfaces
-
IV. Programming with .NET Assemblies
-
15. Introducing .NET Assemblies
- Defining Custom Namespaces
- The Role of .NET Assemblies
- Understanding the Format of a .NET Assembly
- Building and Consuming a Single-File Assembly
- Building and Consuming a Multifile Assembly
- Understanding Private Assemblies
- Understanding Shared Assemblies
- Consuming a Shared Assembly
- Configuring Shared Assemblies
- Investigating the Internal Composition of the GAC
- Understanding Publisher Policy Assemblies
- Understanding the <codeBase> Element
- The System.Configuration Namespace
- The Machine Configuration File
- Summary
-
16. Type Reflection, Late Binding, and Attribute-Based Programming
- The Necessity of Type Metadata
- Understanding Reflection
- Building a Custom Metadata Viewer
- Dynamically Loading Assemblies
- Reflecting on Shared Assemblies
- Understanding Late Binding
- Understanding Attributed Programming
- Building Custom Attributes
- Assembly-Level (and Module-Level) Attributes
- Reflecting on Attributes Using Early Binding
- Reflecting on Attributes Using Late Binding
- Putting Reflection, Late Binding, and Custom Attributes in Perspective
- Building an Extendable Application
- Summary
- 17. Processes, AppDomains, and Object Contexts
-
18. Building Multithreaded Applications
- The Process/AppDomain/Context/Thread Relationship
- A Brief Review of the .NET Delegate
- The Asynchronous Nature of Delegates
- Invoking a Method Asynchronously
- The System.Threading Namespace
- The System.Threading.Thread Class
- Programmatically Creating Secondary Threads
- The Issue of Concurrency
- Programming with Timer Callbacks
- Understanding the CLR ThreadPool
- The Role of the BackgroundWorker Component
- Summary
-
19. Understanding CIL and the Role of Dynamic Assemblies
- Reflecting on the Nature of CIL Programming
- Examining CIL Directives, Attributes, and Opcodes
- Pushing and Popping: The Stack-Based Nature of CIL
- Understanding Round-Trip Engineering
- Understanding CIL Directives and Attributes
- .NET Base Class Library, C#, and CIL Data Type Mappings
- Defining Type Members in CIL
- Examining CIL Opcodes
- Building a .NET Assembly with CIL
- Understanding Dynamic Assemblies
- Summary
-
15. Introducing .NET Assemblies
-
V. Introducing the .NET Base Class Libraries
-
20. File I/O and Isolated Storage
- Exploring the System.IO Namespace
- The Directory(Info) and File(Info) Types
- Working with the DirectoryInfo Type
- Working with the Directory Type
- Working with the DriveInfo Class Type
- Working with the FileInfo Class
- Working with the File Type
- The Abstract Stream Class
- Working with StreamWriters and StreamReaders
- Working with StringWriters and StringReaders
- Working with BinaryWriters and BinaryReaders
- Programmatically "Watching" Files
- Performing Asynchronous File I/O
- Understanding the Role of Isolated Storage
- A Primer on Code Access Security
- An Overview of Isolated Storage
- Obtaining a Store Using IsolatedStorageFile
- Isolated Storage in Action: ClickOnce Deployment
- Summary
-
21. Introducing Object Serialization
- Understanding Object Serialization
- Configuring Objects for Serialization
- Choosing a Serialization Formatter
- Serializing Objects Using the BinaryFormatter
- Serializing Objects Using the SoapFormatter
- Serializing Objects Using the XmlSerializer
- Serializing Collections of Objects
- Customizing the Serialization Process
- Summary
-
22. ADO.NET Part I: The Connected Layer
- A High-Level Definition of ADO.NET
- Understanding ADO.NET Data Providers
- Additional ADO.NET Namespaces
- The Types of the System.Data Namespace
- Abstracting Data Providers Using Interfaces
- Creating the AutoLot Database
- The ADO.NET Data Provider Factory Model
- Understanding the Connected Layer of ADO.NET
- Working with Data Readers
- Building a Reusable Data Access Library
- Creating a Console UIBased Front End
- Asynchronous Data Access Using SqlCommand
- Understanding Database Transactions
- Summary
-
23. ADO.NET Part II: The Disconnected Layer
- Understanding the Disconnected Layer of ADO.NET
- Understanding the Role of the DataSet
- Working with DataColumns
- Working with DataRows
- Working with DataTables
- Binding DataTable Objects to User Interfaces
- Filling DataSet/DataTable Objects Using Data Adapters
- Revisiting AutoLotDAL.dll
- Navigating Multitabled DataSet Objects
- The Data Access Tools of Visual Studio 2008
- Decoupling Autogenerated Code from the UI Layer
- Summary
- 24. Programming with the LINQ APIs
-
25. Introducing Windows Communication Foundation
- A Potpourri of Distributed Computing APIs
- The Role of WCF
- Investigating the Core WCF Assemblies
- The Visual Studio WCF Project Templates
- The Basic Composition of a WCF Application
- The ABCs of WCF
- Building a WCF Service
- Hosting the WCF Service
- Building the WCF Client Application
- Using the WCF Service Library Project Template
- Hosting the WCF Service As a Windows Service
- Invoking a Service Asynchronously
- Designing WCF Data Contracts
- Summary
-
26. Introducing Windows Workflow Foundation
- Defining a Business Process
- The Building Blocks of WF
- WF Assemblies, Namespaces, and Projects
- Building a Simple Workflow-Enabled Application
- Examining the WF Engine Hosting Code
- Invoking Web Services Within Workflows
- Building a Reusable WF Code Library
- A Brief Word Regarding Custom Activities
- Summary
-
20. File I/O and Isolated Storage
-
VI. Desktop User Interfaces
-
27. Programming with Windows Forms
- The Windows Forms Namespaces
- Building a Simple Windows Forms Application (IDE-Free)
- The Visual Studio Windows Forms Project Template
- The Anatomy of a Form
- Responding to Mouse Activity
- Responding to Keyboard Activity
- Designing Dialog Boxes
- Rendering Graphical Data Using GDI+
- Building a Complete Windows Forms Application
- Summary
-
28. Introducing Windows Presentation Foundation and XAML
- The Motivation Behind WPF
- The Various Flavors of WPF Applications
- Investigating the WPF Assemblies
- Building a (XAML-Free) WPF Application
- Additional Details of the Application Type
- Additional Details of the Window Type
- Building a (XAML-Centric) WPF Application
- Transforming Markup into a .NET Assembly
- Separation of Concerns Using Code-Behind Files
- The Syntax of XAML
- Building WPF Applications Using Visual Studio 2008
- Processing XAML at Runtime: SimpleXamlPad.exe
- The Role of Microsoft Expression Blend
- Summary
-
29. Programming with WPF Controls
- A Survey of the WPF Control Library
- Declaring Controls in XAML
- Understanding the Role of Dependency Properties
- Understanding Routed Events
- Working with Button Types
- Working with CheckBoxes and RadioButtons
- Working with the ListBox and ComboBox Types
- Working with Text Areas
- Controlling Content Layout Using Panels
- Building a Window's Frame Using Nested Panels
- Understanding WPF Control Commands
- Understanding the WPF Data-Binding Model
- Data Conversion Using IValueConverter
- Binding to Custom Objects
- Binding UI Elements to XML Documents
- Summary
-
30. WPF 2D Graphical Rendering, Resources, and Themes
- The Philosophy of WPF Graphical Rendering Services
- Exploring the Shape-Derived Types
- Working with WPF Brushes
- Working with WPF Pens
- Exploring the Drawing-Derived Types
- The Role of UI Transformations
- Understanding WPF's Animation Services
- Understanding the WPF Resource System
- Defining and Applying Styles for WPF Controls
- Altering a Control's UI Using Templates
- Summary
-
27. Programming with Windows Forms
-
VII. Building Web Applications with ASP.NET
-
31. Building ASP.NET Web Pages
- The Role of HTTP
- Understanding Web Applications and Web Servers
- The Role of HTML
- The Role of Client-Side Scripting
- Submitting the Form Data (GET and POST)
- Building a Classic ASP Page
- Problems with Classic ASP
- The ASP.NET Namespaces
- The ASP.NET Web Page Code Model
- Details of an ASP.NET Website Directory Structure
- The ASP.NET Page Compilation Cycle
- The Inheritance Chain of the Page Type
- Interacting with the Incoming HTTP Request
- Interacting with the Outgoing HTTP Response
- The Life Cycle of an ASP.NET Web Page
- The Role of the Web.config File
- Summary
-
32. ASP.NET Web Controls, Themes, and Master Pages
- Understanding the Nature of Web Controls
- The System.Web.UI.Control Type
- The System.Web.UI.WebControls.WebControl Type
- Major Categories of ASP.NET Web Controls
- Building a Feature-Rich ASP.NET Website
- The Role of the Validation Controls
- Working with Themes
- Positioning Controls Using HTML Tables
- Summary
-
33. ASP.NET State Management Techniques
- The Issue of State
- ASP.NET State Management Techniques
- Understanding the Role of ASP.NET View State
- The Role of the Global.asax File
- Understanding the Application/Session Distinction
- Working with the Application Cache
- Maintaining Session Data
- Understanding Cookies
- The Role of the <sessionState> Element
- Understanding the ASP.NET Profile API
- Summary
-
31. Building ASP.NET Web Pages
-
VIII. Appendixes
-
A. COM and .NET Interoperability
- The Scope of .NET Interoperability
- A Simple Example of .NET to COM Interop
- Investigating a .NET Interop Assembly
- Understanding the Runtime Callable Wrapper
- The Role of COM IDL
- Using a Type Library to Build an Interop Assembly
- Building a More Elaborate COM Server
- Examining the Interop Assembly
- Understanding COM to .NET Interoperability
- The Role of the CCW
- The Role of the .NET Class Interface
- Building Your .NET Types
- Generating the Type Library and Registering the .NET Types
- Examining the Exported Type Information
- Building a Visual Basic 6.0 Test Client
- Summary
- B. Platform-Independent .NET Development with Mono
-
A. COM and .NET Interoperability
Product information
- Title: Pro C# 2008 and the .NET 3.5 Platform, Fourth Edition
- Author(s):
- Release date: November 2007
- Publisher(s): Apress
- ISBN: 9781590598849
You might also like
book
Pro VB 2010 and the .NET 4 Platform
Be the first to understand .NET 4.0 and Visual Basic 2010. Pro VB 2010 and the …
book
Pro C# 2010 and the .NET 4 Platform, Fifth Edition
The first edition of this book was released at the 2001 Tech-Ed conference in Atlanta, Georgia. …
book
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional, Second Edition
The most up-to-date and comprehensive introductory ASP.NET book you'll find on any shelf, Beginning ASP.NET 3.5 …
book
MCPD 70-518 Exam Ref: Designing and Developing Windows® Applications Using Microsoft® .NET Framework 4
Professional-level prep for the professional-level exam. Prepare for MCPD Exam 70-518—and help demonstrate your real-world mastery …