Part I: Introducing C# and .NET Platform
Chapter 1: The Philosophy of .NET
An Initial Look at the .NET Platform
Some Key Benefits of the .NET Platform
Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS)
The Role of the Base Class Libraries
Additional .NET-Aware Programming Languages
An Overview of .NET Assemblies
The Role of the Common Intermediate Language
The Role of .NET Type Metadata
The Role of the Assembly Manifest
Understanding the Common Type System
Understanding the Common Language Specification
Understanding the Common Language Runtime
The Assembly/Namespace/Type Distinction
The Role of the Microsoft Root Namespace
Accessing a Namespace Programmatically
Referencing External Assemblies
Exploring an Assembly Using ildasm.exe
Viewing Assembly Metadata (a.k.a. the Manifest)
The Platform-Independent Nature of .NET
A Brief Word Regarding Windows 8 Metro-Style Applications
Building Metro-Style Applications
The Role of .NET Under Windows 8
Chapter 2: Building C# Applications
The Role of the .NET Framework 4.5 SDK
Building C# Applications Using csc.exe
Specifying Input and Output Targets
Referencing External Assemblies
Referencing Multiple External Assemblies
Compiling Multiple Source Files
Working with C# Response Files
Building .NET Applications Using Notepad++
Building .NET Applications Using SharpDevelop
Building a Simple Test Project
Building .NET Applications Using Visual C# Express
Some Unique Features of Visual C# Express
Building .NET Applications Using Visual Studio
Some Unique Features of Visual Studio
Targeting the .NET Framework Using the New Project Dialog Box
Using the Solution Explorer Utility
Integrated Support for Code Refactoring
Code Snippets and Surround with Technology
The Integrated .NET Framework 4.5 SDK Documentation System
Chapter 3: Core C# Programming Constructs, Part I
The Anatomy of a Simple C# Program
Variations on the Main() Method
Specifying an Application Error Code
Processing Command-Line Arguments
Specifying Command-Line Arguments with Visual Studio
An Interesting Aside: Some Additional Members of the System.Environment Class
Basic Input and Output with the Console Class
Formatting Numerical Data Beyond Console Applications
System Data Types and Corresponding C# Keywords
Variable Declaration and Initialization
Intrinsic Data Types and the new Operator
Members of Numerical Data Types
Parsing Values from String Data
System.DateTime and System.TimeSpan
The System.Numerics.dll Assembly
The System.Text.StringBuilder Type
Narrowing and Widening Data Type Conversions
Setting Project-Wide Overflow Checking
Understanding Implicitly Typed Local Variables
Restrictions on Implicitly Typed Variables
Implicit Typed Data Is Strongly Typed Data
Usefulness of Implicitly Typed Local Variables
The while and do/while Looping Constructs
Decision Constructs and the Relational/Equality Operators
Equality and Relational Operators
Chapter 4: Core C# Programming Constructs, Part II
Methods and Parameter Modifiers
The Default by Value Parameter-Passing Behavior
Invoking Methods Using Named Parameters
Understanding Method Overloading
C# Array Initialization Syntax
Working with Multidimensional Arrays
Arrays As Arguments or Return Values
Controlling the Underlying Storage for an enum
Dynamically Discovering an enum’s Name/Value Pairs
Understanding the Structure Type
Understanding Value Types and Reference Types
Value Types, References Types, and the Assignment Operator
Value Types Containing Reference Types
Passing Reference Types by Value
Passing Reference Types by Reference
Final Details Regarding Value Types and Reference Types
Understanding C# Nullable Types
Part III: Object-Oriented Programming with C#
Chapter 5: Understanding Encapsulation
Allocating Objects with the new Keyword
The Role of the Default Constructor
The Default Constructor Revisited
Chaining Constructor Calls Using this
Understanding the static Keyword
Access Modifiers and Nested Types
The First Pillar: C#’s Encapsulation Services
Encapsulation Using Traditional Accessors and Mutators
Encapsulation Using .NET Properties
Using Properties Within a Class Definition
Read-Only and Write-Only Properties
Revisiting the static Keyword: Defining Static Properties
Understanding Automatic Properties
Interacting with Automatic Properties
Regarding Automatic Properties and Default Values
Understanding Object Initialization Syntax
Calling Custom Constructors with Initialization Syntax
Working with Constant Field Data
Understanding Read-Only Fields
Chapter 6: Understanding Inheritance and Polymorphism
The Basic Mechanics of Inheritance
Specifying the Parent Class of an Existing Class
Regarding Multiple Base Classes
Revising Visual Studio Class Diagrams
The Second Pillar of OOP: The Details of Inheritance
Controlling Base Class Creation with the base Keyword
Keeping Family Secrets: The protected Keyword
Programming for Containment/Delegation
Understanding Nested Type Definitions
The Third Pillar of OOP: C#’s Polymorphic Support
The virtual and override Keywords
Overriding Virtual Members Using the Visual Studio IDE
Understanding Abstract Classes
Understanding the Polymorphic Interface
Understanding Member Shadowing
Understanding Base Class/Derived Class Casting Rules
The Master Parent Class: System.Object
Overriding System.Object.ToString()
Overriding System.Object.Equals()
Overriding System.Object.GetHashCode()
Testing Your Modified Person Class
The Static Members of System.Object
Chapter 7: Understanding Structured Exception Handling
Ode to Errors, Bugs, and Exceptions
The Role of .NET Exception Handling
The Building Blocks of .NET Exception Handling
The System.Exception Base Class
Configuring the State of an Exception
System-Level Exceptions (System.SystemException)
Application-Level Exceptions (System.ApplicationException)
Building Custom Exceptions, Take One
Building Custom Exceptions, Take Two
Building Custom Exceptions, Take Three
Processing Multiple Exceptions
The Result of Unhandled Exceptions
Debugging Unhandled Exceptions Using Visual Studio
Chapter 8: Working with Interfaces
Interface Types vs. Abstract Base Classes
Invoking Interface Members at the Object Level
Obtaining Interface References: The as Keyword
Obtaining Interface References: The is Keyword
Implementing Interfaces Using Visual Studio
Explicit Interface Implementation
Designing Interface Hierarchies
Multiple Inheritance with Interface Types
The IEnumerable and IEnumerator Interfaces
Building Iterator Methods with the yield Keyword
A More Elaborate Cloning Example
Specifying Multiple Sort Orders with IComparer
Custom Properties and Custom Sort Types
Part IV: Advanced C# Programming
Chapter 9: Collections and Generics
The Motivation for Collection Classes
The System.Collections Namespace
A Survey of System.Collections.Specialized Namespace
The Problems of Nongeneric Collections
A First Look at Generic Collections
The Role of Generic Type Parameters
Specifying Type Parameters for Generic Classes/Structures
Specifying Type Parameters for Generic Members
Specifying Type Parameters for Generic Interfaces
The System.Collections.Generic Namespace
Understanding Collection Initialization Syntax
Working with the List<T> Class
Working with the Stack<T> Class
Working with the Queue<T> Class
Working with the SortedSet<T> Class
The System.Collections.ObjectModel Namespace
Working with ObservableCollection<T>
Creating Custom Generic Methods
Creating Custom Generic Structures and Classes
The default Keyword in Generic Code
Examples Using the where Keyword
The Lack of Operator Constraints
Chapter 10: Delegates, Events, and Lambda Expressions
Understanding the .NET Delegate Type
Defining a Delegate Type in C#
The System.MulticastDelegate and System.Delegate Base Classes
The Simplest Possible Delegate Example
Investigating a Delegate Object
Sending Object State Notifications Using Delegates
Removing Targets from a Delegate’s Invocation List
Method Group Conversion Syntax
Understanding Generic Delegates
The Generic Action<> and Func<> Delegates
Simplifying Event Registration Using Visual Studio
Creating Custom Event Arguments
The Generic EventHandler<T> Delegate
Understanding C# Anonymous Methods
Understanding Lambda Expressions
Dissecting a Lambda Expression
Processing Arguments Within Multiple Statements
Lambda Expressions with Multiple (or Zero) Parameters
Retrofitting the CarEvents Example Using Lambda Expressions
Chapter 11: Advanced C# Language Features
Indexing Data Using String Values
Indexers with Multiple Dimensions
Indexer Definitions on Interface Types
Understanding Operator Overloading
And What of the += and –+ Operators?
Overloading Equality Operators
Overloading Comparison Operators
Final Thoughts Regarding Operator Overloading
Understanding Custom Type Conversions
Recall: Conversions Among Related Class Types
Creating Custom Conversion Routines
Additional Explicit Conversions for the Square Type
Defining Implicit Conversion Routines
Understanding Extension Methods
The IntelliSense of Extension Methods
Extending Types Implementing Specific Interfaces
The Internal Representation of Anonymous Types
The Implementation of ToString() and GetHashCode()
The Semantics of Equality for Anonymous Types
Anonymous Types Containing Anonymous Types
Working with the * and & Operators
An Unsafe (and Safe) Swap Function
Field Access via Pointers (the -> Operator)
Pinning a Type via the fixed Keyword
LINQ-Specific Programming Constructs
Implicit Typing of Local Variables
Object and Collection Initialization Syntax
Understanding the Role of LINQ
LINQ Expressions Are Strongly Typed
Applying LINQ Queries to Primitive Arrays
Reflecting over a LINQ Result Set
LINQ and Implicitly Typed Local Variables
The Role of Deferred Execution
The Role of Immediate Execution
Returning the Result of a LINQ Query
Returning LINQ Results via Immediate Execution
Applying LINQ Queries to Collection Objects
Accessing Contained Subobjects
Applying LINQ Queries to Nongeneric Collections
Filtering Data Using OfType<T>()
Investigating the C# LINQ Query Operators
Obtaining Counts Using Enumerable
LINQ As a Better Venn Diagramming Tool
The Internal Representation of LINQ Query Statements
Building Query Expressions with Query Operators (Revisited)
Building Query Expressions Using the Enumerable Type and Lambda Expressions
Building Query Expressions Using the Enumerable Type and Anonymous Methods
Building Query Expressions Using the Enumerable Type and Raw Delegates
Chapter 13: Understanding Object Lifetime
Classes, Objects, and References
Setting Object References to null
Understanding Object Generations
Concurrent Garbage Collection Under .NET 1.0–3.5
Background Garbage Collection Under .NET 4.0 and Greater
Overriding System.Object.Finalize()
Detailing the Finalization Process
Building Finalizable and Disposable Types
Understanding Lazy Object Instantiation
Customizing the Creation of the Lazy Data
Part V: Programming with .NET Assemblies
Chapter 14: Building and Configuring Class Libraries
Resolving Name Clashes with Fully Qualified Names
Resolving Name Clashes with Aliases
The Default Namespace of Visual Studio
Assemblies Establish a Type Boundary
Assemblies Are Versionable Units
Assemblies Are Self-Describing
Understanding the Format of a .NET Assembly
CIL Code, Type Metadata, and the Assembly Manifest
Building and Consuming Custom Class Library
Building a C# Client Application
Building a Visual Basic Client Application
Cross-Language Inheritance in Action
Understanding Private Assemblies
The Identity of a Private Assembly
Understanding the Probing Process
Configuring Private Assemblies
The Role of the App.Config File
Understanding Shared Assemblies
Generating Strong Names at the Command Line
Generating Strong Names Using Visual Studio
Installing Strongly Named Assemblies to the GAC
Exploring the Manifest of SharedCarLibClient
Freezing the Current Shared Assembly
Building a Shared Assembly Version 2.0.0.0
Dynamically Redirecting to Specific Versions of a Shared Assembly
Understanding Publisher Policy Assemblies
Understanding the <codeBase> Element
The System.Configuration Namespace
The Configuration File Schema Documentation
Chapter 15: Type Reflection, Late Binding, and Attribute-Based Programming
The Necessity of Type Metadata
Viewing (Partial) Metadata for the EngineState Enumeration
Viewing (Partial) Metadata for the Car Type
Documenting the Defining Assembly
Documenting Referenced Assemblies
Obtaining a Type Reference Using System.Object.GetType()
Obtaining a Type Reference Using typeof()
Obtaining a Type Reference Using System.Type.GetType()
Building a Custom Metadata Viewer
Reflecting on Fields and Properties
Reflecting on Implemented Interfaces
Displaying Various Odds and Ends
Reflecting on Method Parameters and Return Values
Dynamically Loading Assemblies
Reflecting on Shared Assemblies
Invoking Methods with No Parameters
Invoking Methods with Parameters
Understanding the Role of .NET Attributes
C# Attribute Shorthand Notation
Specifying Constructor Parameters for Attributes
The Obsolete Attribute in Action
The Visual Studio AssemblyInfo.cs File
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
Building CommonSnappableTypes.dll
Building the Visual Basic Snap-In
Building an Extendable Windows Forms Application
Chapter 16: Dynamic Types and the Dynamic Language Runtime
The Role of the C# dynamic Keyword
Calling Members on Dynamically Declared Data
The Role of the Microsoft.CSharp.dll Assembly
The Scope of the dynamic Keyword
Limitations of the dynamic Keyword
Practical Uses of the dynamic Keyword
The Role of the Dynamic Language Runtime (DLR)
The Role of the System.Dynamic Namespace
Dynamic Runtime Lookup of Expression Trees
Simplifying Late-Bound Calls Using Dynamic Types
Leveraging the dynamic Keyword to Pass Arguments
Simplifying COM Interoperability Using Dynamic Data
The Role of Primary Interop Assemblies (PIAs)
Common COM Interop Pain Points
COM Interop Using C# Dynamic Data
COM interop Without C# Dynamic Data
Chapter 17: Processes, AppDomains, and Object Contexts
Interacting with Processes Under the .NET Platform
Investigating a Specific Process
Investigating a Process’s Thread Set
Investigating a Process’s Module Set
Starting and Stopping Processes Programmatically
Controlling Process Startup Using the ProcessStartInfo Class
Understanding .NET Application Domains
Interacting with the Default Application Domain
Receiving Assembly Load Notifications
Creating New Application Domains
Loading Assemblies into Custom Application Domains
Programmatically Unloading AppDomains
Understanding Object Context Boundaries
Context-Agile and Context-Bound Types
Defining a Context-Bound Object
Inspecting an Object’s Context
Summarizing Processes, AppDomains, and Context
Chapter 18: Understanding CIL and the Role of Dynamic Assemblies
Reasons for Learning the Grammar of CIL
Examining CIL Directives, Attributes, and Opcodes
The CIL Opcode/CIL Mnemonic Distinction
Pushing and Popping: The Stack-Based Nature of CIL
Understanding Round-Trip Engineering
Interacting with CIL: Modifying an *.il File
Compiling CIL Code Using ilasm.exe
Understanding CIL Directives and Attributes
Specifying Externally Referenced Assemblies in CIL
Defining the Current Assembly in CIL
Defining and Implementing Interfaces in CIL
Compiling the CILTypes.il file
.NET Base Class Library, C#, and CIL Data Type Mappings
Defining Type Constructors in CIL
Declaring Local Variables in CIL
Mapping Parameters to Local Variables in CIL
Representing Iteration Constructs in CIL
Building a .NET Assembly with CIL
Understanding Dynamic Assemblies
Exploring the System.Reflection.Emit Namespace
The Role of the System.Reflection.Emit.ILGenerator
Emitting the Assembly and Module Set
The Role of the ModuleBuilder Type
Emitting the HelloClass Type and the String Member Variable
Emitting the SayHello() Method
Using the Dynamically Generated Assembly
Part VI: Introducing the .NET Base Class Libraries
Chapter 19: Multithreaded, Parallel, and Async Programming
The Process/AppDomain/Context/Thread Relationship
The Role of Thread Synchronization
A Brief Review of the .NET Delegate
The Asynchronous Nature of Delegates
The BeginInvoke() and EndInvoke() Methods
The System.IAsyncResult Interface
Invoking a Method Asynchronously
Synchronizing the Calling Thread
The Role of the AsyncCallback Delegate
The Role of the AsyncResult Class
Passing and Receiving Custom State Data
The System.Threading Namespace
The System.Threading.Thread Class
Obtaining Statistics About the Current Thread of Execution
Manually Creating Secondary Threads
Working with the ThreadStart Delegate
Working with the ParameterizedThreadStart Delegate
Foreground Threads and Background Threads
Synchronization Using the C# lock Keyword
Synchronization Using the System.Threading.Monitor Type
Synchronization Using the System.Threading.Interlocked Type
Synchronization Using the [Synchronization] Attribute
Programming with Timer Callbacks
Understanding the CLR ThreadPool
Parallel Programming Using the Task Parallel Library
The System.Threading.Tasks Namespace
The Role of the Parallel Class
Data Parallelism with the Parallel Class
Accessing UI Elements on Secondary Threads
Task Parallelism Using the Parallel Class
Asynchronous Calls Under .NET 4.5
A First Look at the C# async and await Keywords
Naming Conventions for Async Methods
Async Methods with Multiple Awaits
Retrofitting the AddWithThreads Example Using Asycn/Await
Chapter 20: File I/O and Object Serialization
Exploring the System.IO Namespace
The Directory(Info) and File(Info) Types
The Abstract FileSystemInfo Base Class
Working with the DirectoryInfo Type
Enumerating Files with the DirectoryInfo Type
Creating Subdirectories with the DirectoryInfo Type
Working with the Directory Type
Working with the DriveInfo Class Type
Working with the FileInfo Class
The FileInfo.OpenRead() and FileInfo.OpenWrite() Methods
The FileInfo.OpenText() Method
The FileInfo.CreateText() and FileInfo.AppendText() Methods
Additional File-Centric Members
Working with StreamWriters and StreamReaders
Directly Creating StreamWriter/StreamReader Types
Working with StringWriters and StringReaders
Working with BinaryWriters and BinaryReaders
Watching Files Programmatically
Understanding Object Serialization
Configuring Objects for Serialization
Public Fields, Private Fields, and Public Properties
Choosing a Serialization Formatter
The IFormatter and IRemotingFormatter Interfaces
Type Fidelity Among the Formatters
Serializing Objects Using the BinaryFormatter
Deserializing Objects Using the BinaryFormatter
Serializing Objects Using the SoapFormatter
Serializing Objects Using the XmlSerializer
Controlling the Generated XML Data
Serializing Collections of Objects
Customizing the Soap/Binary Serialization Process
A Deeper Look at Object Serialization
Customizing Serialization Using ISerializable
Customizing Serialization Using Attributes
Chapter 21: ADO.NET Part I: The Connected Layer
A High-Level Definition of ADO.NET
Understanding ADO.NET Data Providers
The Microsoft-Supplied ADO.NET Data Providers
A Word Regarding System.Data.OracleClient.dll
Obtaining Third-Party ADO.NET Data Providers
The Types of the System.Data Namespace
The Role of the IDbConnection Interface
The Role of the IDbTransaction Interface
The Role of the IDbCommand Interface
The Role of the IDbDataParameter and IDataParameter Interfaces
The Role of the IDbDataAdapter and IDataAdapter Interfaces
The Role of the IDataReader and IDataRecord Interfaces
Abstracting Data Providers Using Interfaces
Increasing Flexibility Using Application Configuration Files
Adding Test Records to the Inventory Table
Authoring the GetPetName() Stored Procedure
Creating the Customers and Orders Tables
Visually Creating Table Relationships
The ADO.NET Data Provider Factory Model
A Complete Data Provider Factory Example
A Potential Drawback with the Data Provider Factory Model
The <connectionStrings> Element
Understanding the Connected Layer of ADO.NET
Working with Connection Objects
Working with ConnectionStringBuilder Objects
Obtaining Multiple Result Sets Using a Data Reader
Building a Reusable Data Access Library
Working with Parameterized Command Objects
Creating a Console UI–Based Front End
Implementing the Main() Method
Implementing the ShowInstructions() Method
Implementing the ListInventory() Method
Implementing the DeleteCar() Method
Implementing the InsertNewCar() Method
Implementing the UpdateCarPetName() Method
Understanding Database Transactions
Key Members of an ADO.NET Transaction Object
Adding a CreditRisks Table to the AutoLot Database
Adding a Transaction Method to InventoryDAL
Testing Your Database Transaction
Chapter 22: ADO.NET Part II: The Disconnected Layer
Understanding the Disconnected Layer of ADO.NET
Understanding the Role of the DataSet
Enabling Autoincrementing Fields
Adding DataColumn Objects to a DataTable
Understanding the RowState Property
Understanding the DataRowVersion Property
Inserting DataTables into DataSets
Processing DataTable Data Using DataTableReader Objects
Serializing DataTable/DataSet Objects As XML
Serializing DataTable/DataSet Objects in a Binary Format
Binding DataTable Objects to Windows Forms GUIs
Hydrating a DataTable from a Generic List<T>
Deleting Rows from a DataTable
Selecting Rows Based on Filter Criteria
Updating Rows Within a DataTable
Working with the DataView Type
Mapping Database Names to Friendly Names
Adding Disconnection Functionality to AutoLotDAL.dll
Defining the Initial Class Type
Configuring the Data Adapter Using the SqlCommandBuilder
Implementing GetAllInventory()
Implementing UpdateInventory()
Testing the Disconnected Functionality
Multitabled DataSet Objects and Data Relationships
Building the Table Relationships
Navigating Between Related Tables
The Windows Forms Database Designer Tools
Visually Designing the DataGridView
Examining the Strongly Typed DataSet
Examining the Strongly Typed DataTable
Examining the Strongly Typed DataRow
Examining the Strongly Typed Data Adapter
Completing the Windows Forms Application
Isolating Strongly Typed Database Code into a Class Library
Selecting Data with the Generated Code
Inserting Data with the Generated Code
Deleting Data with the Generated Code
Invoking a Stored Procedure Using the Generated Code
Programming with LINQ to DataSet
The Role of the DataSet Extensions Library
Obtaining a LINQ-Compatible DataTable
The Role of the DataRowExtensions.Field<T>() Extension Method
Hydrating New DataTables from LINQ Queries
Chapter 23: ADO.NET Part III: The Entity Framework
Understanding the Role of Entity Framework
The Building Blocks of the Entity Framework
Building and Analyzing Your First EDM
Programming Against the Conceptual Model
AutoLotDAL Version Four, Now with Entities
The Role of Navigation Properties
Using Navigation Properties within LINQ to Entity Queries
Data Binding Entities to Windows Forms GUIs
Going Forward with .NET Data-Access APIs
Chapter 24: Introducing LINQ to XML
VB Literal Syntax As a Better LINQ to XML
Members of the System.Xml.Linq Namespace
The Oddness of XName (and XNamespace)
Working with XElement and XDocument
Generating Documents from Arrays and Containers
Loading and Parsing XML Content
Manipulating an In-Memory XML Document
Building the UI of the LINQ to XML App
Defining a LINQ to XML Helper Class
Attaching the UI to Your Helper Class
Chapter 25: Introducing Windows Communication Foundation
A Potpourri of Distributed Computing APIs
The Role of COM+/Enterprise Services
An Overview of Service-Oriented Architecture
Investigating the Core WCF Assemblies
The Visual Studio WCF Project Templates
The WCF Service Web Site Project Template
The Basic Composition of a WCF Application
The [ServiceContract] Attribute
The [OperationContract] Attribute
Service Types As Operational Contracts
Establishing the ABCs Within an App.config File
Coding Against the ServiceHost Type
Details of the ServiceHost Type
Details of the <system.serviceModel> Element
Building the WCF Client Application
Generating Proxy Code Using svcutil.exe
Generating Proxy Code Using Visual Studio
Configuring a TCP-Based Binding
Simplifying Configuration Settings
Exposing a Single WCF Service Using Multiple Bindings
Changing Settings for a WCF Binding
Leveraging the Default MEX Behavior Configuration
Refreshing the Client Proxy and Selecting the Binding
Using the WCF Service Library Project Template
Building a Simple Math Service
Testing the WCF Service with WcfTestClient.exe
Altering Configuration Files Using SvcConfigEditor.exe
Hosting the WCF Service Within a Windows Service
Creating a Windows Service Installer
Installing the Windows Service
Invoking a Service Asynchronously from the Client
Using the Web-Centric WCF Service Project Template
Implementing the Service Contract
Chapter 26: Introducing Windows Workflow Foundation
Hosting a Workflow Using WorkflowInvoker
Hosting a Workflow Using WorkflowApplication
Examining the Workflow Activities
The Runtime and Primitives Activities
The Collection and Error Handling Activities
Connecting Activities in a Flowchart
Working with the InvokeMethod Activity
Defining Workflow-Wide Variables
Working with the FlowDecision Activity
Working with the TerminateWorkflow Activity
Working with the ForEach<T> Activity
Reflecting on What We Have Done
Building a Sequence Workflow (in a Dedicated DLL)
Importing Assemblies and Namespaces
Defining the Workflow Arguments
Working with the Assign Activity
Working with the If and Switch Activities
Building a Custom Code Activity
Consuming the Workflow Library
Retrieving the Workflow Output Argument
Part VII: Windows Presentation Foundation
Chapter 27: Introducing Windows Presentation Foundation and XAML
Providing a Separation of Concerns via XAML
Providing an Optimized Rendering Model
Simplifying Complex UI Programming
Traditional Desktop Applications
Navigation-Based WPF Applications
The WPF/Silverlight Relationship
Investigating the WPF Assemblies
The Role of the Application Class
Building a WPF Application Without XAML
Creating a Strongly Typed Window
Creating a Simple User Interface
Interacting with Application-Level Data
Handling the Closing of a Window Object
Building a WPF Application Using Only XAML
Defining a Window Object in XAML
Defining the Application Object in XAML
Processing the XAML Files Using msbuild.exe
Transforming Markup into a .NET Assembly
Mapping the Window XAML Markup to C# Code
Mapping the Application XAML Markup to C# Code
XAML-to-Assembly Process Summary
Understanding the Syntax of WPF XAML
XAML XML Namespaces and XAML “Keywords”
Controlling Class and Member Variable Visibility
XAML Elements, XAML Attributes, and Type Converters
Understanding XAML Property-Element Syntax
Understanding XAML Attached Properties
Understanding XAML Markup Extensions
Building a WPF Application Using Code-Behind Files
Adding a Code File for the MainWindow Class
Adding a Code File for the MyApp Class
Processing the Code Files with msbuild.exe
Building WPF Applications Using Visual Studio
The Toolbox and XAML Designer/Editor
Setting Properties Using the Properties Window
Handling Events Using the Properties Window
Handling Events in the XAML Editor
Viewing the AutoGenerated Code Files
Building a Custom XAML Editor with Visual Studio
Designing the GUI of Our Window
Implementing the Button’s Click Event
Exploring the WPF Documentation
Chapter 28: Programming with WPF Controls
A Survey of the Core WPF Controls
The Details Are in the Documentation
A Brief Review of the Visual Studio WPF Designer
Working with WPF Controls Using Visual Studio
Working with the Document Outline Editor
Controlling Content Layout Using Panels
Positioning Content Within Canvas Panels
Positioning Content Within WrapPanel Panels
Positioning Content Within StackPanel Panels
Positioning Content Within Grid Panels
Positioning Content Within DockPanel Panels
Enabling Scrolling for Panel Types
Configuring Panels Using the Visual Studio Designers
Building a Window’s Frame Using Nested Panels
Implementing the MouseEnter/MouseLeave Event Handlers
Implementing the Spell Checking Logic
Connecting Commands to the Command Property
Connecting Commands to Arbitrary Actions
Working with the Open and Save Commands
A Deeper Look at WPF APIs and Controls
Handling Events for the Ink API Tab
Saving, Loading, and Clearing InkCanvas Data
Block Elements and Inline Elements
Populating a FlowDocument Using Code
Enabling Annotations and Sticky Notes
Saving and Loading a Flow Document
Introducing the WPF Data-Binding Model
Establishing Data Bindings Using Visual Studio
Data Conversion Using IValueConverter
Establishing Data Bindings in Code
Chapter 29: WPF Graphics Rendering Services
Understanding WPF’s Graphical Rendering Services
WPF Graphical Rendering Options
Rendering Graphical Data Using Shapes
Adding Rectangles, Ellipses, and Lines to a Canvas
Removing Rectangles, Ellipses, and Lines from a Canvas
Working with Polylines and Polygons
Configuring Brushes Using Visual Studio
Applying Graphical Transformations
A First Look at Transformations
Working with the Visual Studio Transform Editor
Applying Transformations at Design Time
Transforming the Canvas in Code
Rendering Graphical Data Using Drawings and Geometries
Building a DrawingBrush Using Geometries
Painting with the DrawingBrush
Containing Drawing Types in a DrawingImage
Exporting a Sample Design File As XAML
Importing the Graphical Data into a WPF Project
Rendering Graphical Data Using the Visual Layer
Chapter 30: WPF Resources, Animations, and Styles
Understanding the WPF Resource System
Working with Object (Logical) Resources
The Role of the Resources Property
Defining Window-Wide Resources
The {StaticResource} Markup Extension
The {DynamicResource} Markup Extension
Defining Merged Resource Dictionaries
Defining a Resource-Only Assembly
Understanding WPF’s Animation Services
The Role of the Animation Class Types
The To, From, and By Properties
The Role of the Timeline Base Class
Authoring an Animation in C# Code
Controlling the Pace of an Animation
Reversing and Looping an Animation
Animation Using Discrete Key Frames
Understanding the Role of WPF Styles
Automatically Applying a Style with TargetType
Defining Styles with Multiple Triggers
Assigning Styles Programmatically
Chapter 31: Dependency Properties, Routed Events, and Templates
Understanding the Role of Dependency Properties
Examining an Existing Dependency Property
Important Notes Regarding CLR Property Wrappers
Building a Custom Dependency Property
Adding a Data Validation Routine
Responding to the Property Change
The Role of Routed Bubbling Events
Continuing or Halting Bubbling
The Role of Routed Tunneling Events
Logical Trees, Visual Trees, and Default Templates
Programmatically Inspecting a Logical Tree
Programmatically Inspecting a Visual Tree
Programmatically Inspecting a Control’s Default Template
Building a Control Template with the Trigger Framework
Incorporating Visual Cues Using Triggers
The Role of the {TemplateBinding} Markup Extension
Incorporating Templates into Styles
Chapter 32: Introducing ASP.NET Web Forms
The HTTP Request/Response Cycle
Understanding Web Applications and Web Servers
The Role of IIS Virtual Directories
The ASP.NET Development Web Server
The Visual Studio HTML Designer Tools
The Role of Client-Side Scripting
A Client-Side Scripting Example
Posting Back to the Web Server
An Overview of the ASP.NET API
Major Features of ASP.NET 2.0 and Higher
Major Features of ASP.NET 3.5 (and .NET 3.5 SP1) and Higher
Major Features of ASP.NET 4.0 and 4.5
Building a Single-File ASP.NET Web Page
The Role of ASP.NET Directives
Analyzing the ASP.NET Control Declarations
Building an ASP.NET Web Page Using Code Files
Referencing the AutoLotDAL.dll Assembly
Debugging and Tracing ASP.NET Pages
ASP.NET Web Sites vs. ASP.NET Web Applications
The ASP.NET Web Site Directory Structure
The Role of the App_Code Folder
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 AutoEventWireup Attribute
The Role of the web.config File
The ASP.NET Web Site Administration Utility
Chapter 33: ASP.NET Web Controls, Master Pages, and Themes
Understanding the Nature of Web Controls
Understanding Server-Side Event Handling
The Control and WebControl Base Classes
Enumerating Contained Controls
Dynamically Adding and Removing Controls
Interacting with Dynamically Created Controls
Functionality of the WebControl Base Class
Major Categories of ASP.NET Web Controls
A Brief Word Regarding System.Web.UI.HtmlControls
Building the ASP.NET Cars Web Site
Working with ASP.NET Master Pages
Defining the Default Content Page
Designing the Inventory Content Page
Designing the Build-a-Car Content Page
The Role of the Validation Controls
Enabling Client-Side JavaScript Validation Support
The RegularExpressionValidator
Applying Themes at the Page Level
Assigning Themes Programmatically
Chapter 34: ASP.NET State Management Techniques
ASP.NET State Management Techniques
Understanding the Role of ASP.NET View State
The Role of the Global.asax File
The Global Last-Chance Exception Event Handler
The HttpApplication Base Class
Understanding the Application/Session Distinction
Maintaining Application-Level State Data
Handling Web Application Shutdown
Working with the Application Cache
Additional Members of HttpSessionState
The Role of the <sessionState> Element
Storing Session Data in the ASP.NET Session State Server
Storing Session Data in a Dedicated Database
Introducing the ASP.NET Profile API
Defining a User Profile Within web.config
Accessing Profile Data Programmatically
3.137.221.116