You are previewing Beginning Visual C# 2010.
O'Reilly logo
Beginning Visual C# 2010

Book Description

Update to Wrox's leading C# book for beginners

Get ready for the next release of Microsoft's C# programming language with this essential Wrox beginner's guide. Beginning Microsoft Visual C# 2010 starts with the basics and brings you thoroughly up to speed. You'll first cover the fundamentals such as variables, flow control, and object-oriented programming and gradually build your skills for Web and Windows programming, Windows forms, and data access.

Step-by-step directions walk you through processes and invite you to "Try it Out," at every stage. By the end, you'll be able to write useful programming code following the steps you've learned in this thorough, practical book.

  • The C# 4 programming language version will be synonymous with writing code with in C# 2010 in Visual Studio 2010, and you can use it to write Windows applications, Web apps with ASP.NET, and Windows Mobile and Embedded CE apps

  • Provides step-by-step instructions for mastering topics such as variables, flow controls, and object-oriented programming before moving to Web and Windows programming and data access

  • Addresses expressions, functions, debugging, error handling, classes, collections, comparisons, conversions, and more

  • If you've always wanted to master Visual C# programming, this book is the perfect one-stop resource.

    Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

    Table of Contents

    1. Copyright
    2. ABOUT THE AUTHORS
    3. ABOUT THE TECHNICAL EDITOR
    4. CREDITS
    5. ACKNOWLEDGMENTS
    6. INTRODUCTION
      1. WHO THIS BOOK IS FOR
      2. WHAT'S NEW IN THIS EDITION
      3. HOW THIS BOOK IS STRUCTURED
        1. The C# Language (Chapters 1–14)
        2. Windows Programming (Chapters 15–17)
        3. Web Programming (Chapters 18–20)
        4. Data Access (Chapters 21–24)
        5. Additional Techniques (Chapters 25–27)
      4. WHAT YOU NEED TO USE THIS BOOK
      5. CONVENTIONS
      6. SOURCE CODE
      7. ERRATA
      8. P2P.WROX.COM
    7. I. The C# Language
      1. 1. Introducing C#
        1. 1.1. WHAT IS THE .NET FRAMEWORK?
          1. 1.1.1. What's in the .NET Framework?
          2. 1.1.2. Writing Applications Using the .NET Framework
            1. 1.1.2.1. CIL and JIT
            2. 1.1.2.2. Assemblies
            3. 1.1.2.3. Managed Code
            4. 1.1.2.4. Garbage Collection
            5. 1.1.2.5. Fitting It Together
            6. 1.1.2.6. Linking
        2. 1.2. WHAT IS C#?
          1. 1.2.1. Applications You Can Write with C#
          2. 1.2.2. C# in This Book
        3. 1.3. VISUAL STUDIO 2010
          1. 1.3.1. Visual Studio 2010 Express Products
          2. 1.3.2. Solutions
        4. 1.4. SUMMARY
      2. 2. Writing a C# Program
        1. 2.1. THE DEVELOPMENT ENVIRONMENTS
          1. 2.1.1. Visual Studio 2010
          2. 2.1.2. Visual C# 2010 Express Edition
        2. 2.2. CONSOLE APPLICATIONS
          1. 2.2.1. The Solution Explorer
          2. 2.2.2. The Properties Window
          3. 2.2.3. The Error List Window
        3. 2.3. WINDOWS FORMS APPLICATIONS
        4. 2.4. SUMMARY
      3. 3. Variables and Expressions
        1. 3.1. BASIC C# SYNTAX
        2. 3.2. BASIC C# CONSOLE APPLICATION STRUCTURE
        3. 3.3. VARIABLES
          1. 3.3.1. Simple Types
          2. 3.3.2. Variable Naming
            1. 3.3.2.1. Naming Conventions
          3. 3.3.3. Literal Values
            1. 3.3.3.1. String Literals
          4. 3.3.4. Variable Declaration and Assignment
        4. 3.4. EXPRESSIONS
          1. 3.4.1. Mathematical Operators
          2. 3.4.2. Assignment Operators
          3. 3.4.3. Operator Precedence
          4. 3.4.4. Namespaces
        5. 3.5. SUMMARY
      4. 4. Flow Control
        1. 4.1. BOOLEAN LOGIC
          1. 4.1.1. Boolean Assignment Operators
          2. 4.1.2. Bitwise Operators
          3. 4.1.3. Operator Precedence Updated
        2. 4.2. THE GOTO STATEMENT
        3. 4.3. BRANCHING
          1. 4.3.1. The Ternary Operator
          2. 4.3.2. The if Statement
            1. 4.3.2.1. Checking More Conditions Using if Statements
          3. 4.3.3. The switch Statement
        4. 4.4. LOOPING
          1. 4.4.1. do Loops
          2. 4.4.2. while Loops
          3. 4.4.3. for Loops
          4. 4.4.4. Interrupting Loops
          5. 4.4.5. Infinite Loops
        5. 4.5. SUMMARY
      5. 5. More About Variables
        1. 5.1. TYPE CONVERSION
          1. 5.1.1. Implicit Conversions
          2. 5.1.2. Explicit Conversions
          3. 5.1.3. Explicit Conversions Using the Convert Commands
        2. 5.2. COMPLEX VARIABLE TYPES
          1. 5.2.1. Enumerations
            1. 5.2.1.1. Defining Enumerations
          2. 5.2.2. Structs
            1. 5.2.2.1. Defining Structs
          3. 5.2.3. Arrays
            1. 5.2.3.1. Declaring Arrays
            2. 5.2.3.2. foreach Loops
            3. 5.2.3.3. Multidimensional Arrays
            4. 5.2.3.4. Arrays of Arrays
        3. 5.3. STRING MANIPULATION
        4. 5.4. SUMMARY
      6. 6. Functions
        1. 6.1. DEFINING AND USING FUNCTIONS
          1. 6.1.1. Return Values
          2. 6.1.2. Parameters
            1. 6.1.2.1. Parameter Matching
            2. 6.1.2.2. Parameter Arrays
            3. 6.1.2.3. Reference and Value Parameters
            4. 6.1.2.4. Out Parameters
        2. 6.2. VARIABLE SCOPE
          1. 6.2.1. Variable Scope in Other Structures
          2. 6.2.2. Parameters and Return Values versus Global Data
        3. 6.3. THE MAIN() FUNCTION
        4. 6.4. STRUCT FUNCTIONS
        5. 6.5. OVERLOADING FUNCTIONS
        6. 6.6. DELEGATES
        7. 6.7. SUMMARY
      7. 7. Debugging and Error Handling
        1. 7.1. DEBUGGING IN VS AND VCE
          1. 7.1.1. Debugging in Nonbreak (Normal) Mode
            1. 7.1.1.1. Outputting Debugging Information
            2. 7.1.1.2. Tracepoints
            3. 7.1.1.3. Diagnostics Output Versus Tracepoints
          2. 7.1.2. Debugging in Break Mode
            1. 7.1.2.1. Entering Break Mode
              1. 7.1.2.1.1. Breakpoints
              2. 7.1.2.1.2. Other Ways to Enter Break Mode
            2. 7.1.2.2. Monitoring Variable Content
            3. 7.1.2.3. Stepping Through Code
            4. 7.1.2.4. Immediate and Command Windows
            5. 7.1.2.5. The Call Stack Window
        2. 7.2. ERROR HANDLING
          1. 7.2.1. try . . . catch . . . finally
          2. 7.2.2. Listing and Configuring Exceptions
          3. 7.2.3. Notes on Exception Handling
        3. 7.3. SUMMARY
      8. 8. Introduction to Object-Oriented Programming
        1. 8.1. WHAT IS OBJECT-ORIENTED PROGRAMMING?
          1. 8.1.1. What Is an Object?
            1. 8.1.1.1. Properties and Fields
            2. 8.1.1.2. Methods
          2. 8.1.2. Everything's an Object
          3. 8.1.3. The Life Cycle of an Object
            1. 8.1.3.1. Constructors
            2. 8.1.3.2. Destructors
          4. 8.1.4. Static and Instance Class Members
            1. 8.1.4.1. Static Constructors
            2. 8.1.4.2. Static Classes
        2. 8.2. OOP TECHNIQUES
          1. 8.2.1. Interfaces
            1. 8.2.1.1. Disposable Objects
          2. 8.2.2. Inheritance
          3. 8.2.3. Polymorphism
            1. 8.2.3.1. Interface Polymorphism
          4. 8.2.4. Relationships Between Objects
            1. 8.2.4.1. Containment
            2. 8.2.4.2. Collections
          5. 8.2.5. Operator Overloading
          6. 8.2.6. Events
          7. 8.2.7. Reference Types Versus Value Types
        3. 8.3. OOP IN WINDOWS APPLICATIONS
        4. 8.4. SUMMARY
      9. 9. Defining Classes
        1. 9.1. CLASS DEFINITIONS IN C#
          1. 9.1.1. Interface Definitions
        2. 9.2. SYSTEM.OBJECT
        3. 9.3. CONSTRUCTORS AND DESTRUCTORS
          1. 9.3.1. Constructor Execution Sequence
        4. 9.4. OOP TOOLS IN VS AND VCE
          1. 9.4.1. The Class View Window
          2. 9.4.2. The Object Browser
          3. 9.4.3. Adding Classes
          4. 9.4.4. Class Diagrams
        5. 9.5. CLASS LIBRARY PROJECTS
        6. 9.6. INTERFACES VERSUS ABSTRACT CLASSES
        7. 9.7. STRUCT TYPES
        8. 9.8. SHALLOW COPYING VERSUS DEEP COPYING
        9. 9.9. SUMMARY
      10. 10. Defining Class Members
        1. 10.1. MEMBER DEFINITIONS
          1. 10.1.1. Defining Fields
          2. 10.1.2. Defining Methods
          3. 10.1.3. Defining Properties
          4. 10.1.4. Adding Members from a Class Diagram
            1. 10.1.4.1. Adding Methods
            2. 10.1.4.2. Adding Properties
            3. 10.1.4.3. Adding Fields
          5. 10.1.5. Refactoring Members
          6. 10.1.6. Automatic Properties
        2. 10.2. ADDITIONAL CLASS MEMBER TOPICS
          1. 10.2.1. Hiding Base Class Methods
          2. 10.2.2. Calling Overridden or Hidden Base Class Methods
            1. 10.2.2.1. The this Keyword
          3. 10.2.3. Nested Type Definitions
        3. 10.3. INTERFACE IMPLEMENTATION
          1. 10.3.1. Implementing Interfaces in Classes
            1. 10.3.1.1. Explicit Interface Member Implementation
            2. 10.3.1.2. Adding Property Accessors with Nonpublic Accessibility
        4. 10.4. PARTIAL CLASS DEFINITIONS
        5. 10.5. PARTIAL METHOD DEFINITIONS
        6. 10.6. EXAMPLE APPLICATION
          1. 10.6.1. Planning the Application
            1. 10.6.1.1. The Card Class
            2. 10.6.1.2. The Deck Class
          2. 10.6.2. Writing the Class Library
            1. 10.6.2.1. Adding the Suit and Rank Enumerations
            2. 10.6.2.2. Adding the Card Class
            3. 10.6.2.3. Adding the Deck Class
          3. 10.6.3. A Client Application for the Class Library
        7. 10.7. THE CALL HIERARCHY WINDOW
        8. 10.8. SUMMARY
      11. 11. Collections, Comparisons, and Conversions
        1. 11.1. COLLECTIONS
          1. 11.1.1. Using Collections
          2. 11.1.2. Defining Collections
          3. 11.1.3. Indexers
          4. 11.1.4. Adding a Cards Collection to CardLib
          5. 11.1.5. Keyed Collections and IDictionary
          6. 11.1.6. Iterators
          7. 11.1.7. Iterators and Collections
          8. 11.1.8. Deep Copying
          9. 11.1.9. Adding Deep Copying to CardLib
        2. 11.2. COMPARISONS
          1. 11.2.1. Type Comparisons
            1. 11.2.1.1. Boxing and Unboxing
            2. 11.2.1.2. The is Operator
          2. 11.2.2. Value Comparisons
            1. 11.2.2.1. Operator Overloading
            2. 11.2.2.2. Adding Operator Overloads to CardLib
            3. 11.2.2.3. The IComparable and IComparer Interfaces
            4. 11.2.2.4. Sorting Collections Using the IComparable and IComparer Interfaces
        3. 11.3. CONVERSIONS
          1. 11.3.1. Overloading Conversion Operators
          2. 11.3.2. The as Operator
        4. 11.4. SUMMARY
      12. 12. Generics
        1. 12.1. WHAT ARE GENERICS?
        2. 12.2. USING GENERICS
          1. 12.2.1. Nullable Types
            1. 12.2.1.1. Operators and Nullable Types
            2. 12.2.1.2. The ?? Operator
          2. 12.2.2. The System.Collections.Generics Namespace
            1. 12.2.2.1. List<T>
            2. 12.2.2.2. Sorting and Searching Generic Lists
            3. 12.2.2.3. Dictionary<K, V>
            4. 12.2.2.4. Modifying CardLib to Use a Generic Collection Class
        3. 12.3. DEFINING GENERIC TYPES
          1. 12.3.1. Defining Generic Classes
            1. 12.3.1.1. The default Keyword
            2. 12.3.1.2. Constraining Types
            3. 12.3.1.3. Inheriting from Generic Classes
            4. 12.3.1.4. Generic Operators
            5. 12.3.1.5. Generic Structs
          2. 12.3.2. Defining Generic Interfaces
          3. 12.3.3. Defining Generic Methods
          4. 12.3.4. Defining Generic Delegates
        4. 12.4. VARIANCE
          1. 12.4.1. Covariance
          2. 12.4.2. Contravariance
        5. 12.5. SUMMARY
      13. 13. Additional OOP Techniques
        1. 13.1. THE :: OPERATOR AND THE GLOBAL NAMESPACE QUALIFIER
        2. 13.2. CUSTOM EXCEPTIONS
          1. 13.2.1. Adding Custom Exceptions to CardLib
        3. 13.3. EVENTS
          1. 13.3.1. What Is an Event?
          2. 13.3.2. Handling Events
          3. 13.3.3. Defining Events
            1. 13.3.3.1. Multipurpose Event Handlers
            2. 13.3.3.2. The EventHandler and Generic EventHandler<T> Types
            3. 13.3.3.3. Return Values and Event Handlers
            4. 13.3.3.4. Anonymous Methods
        4. 13.4. EXPANDING AND USING CARDLIB
          1. 13.4.1. A Card Game Client for CardLib
        5. 13.5. SUMMARY
      14. 14. C# Language Enhancements
        1. 14.1. INITIALIZERS
          1. 14.1.1. Object Initializers
          2. 14.1.2. Collection Initializers
        2. 14.2. TYPE INFERENCE
        3. 14.3. ANONYMOUS TYPES
        4. 14.4. DYNAMIC LOOKUP
          1. 14.4.1. The dynamic Type
          2. 14.4.2. IDynamicMetaObjectProvider
        5. 14.5. ADVANCED METHOD PARAMETERS
          1. 14.5.1. Optional Parameters
            1. 14.5.1.1. Optional Parameter Values
            2. 14.5.1.2. Optional Parameter Order
          2. 14.5.2. Named Parameters
          3. 14.5.3. Named and Optional Parameter Guidelines
        6. 14.6. EXTENSION METHODS
        7. 14.7. LAMBDA EXPRESSIONS
          1. 14.7.1. Anonymous Methods Recap
          2. 14.7.2. Lambda Expressions for Anonymous Methods
          3. 14.7.3. Lambda Expression Parameters
          4. 14.7.4. Lambda Expression Statement Bodies
          5. 14.7.5. Lambda Expressions As Delegates and Expression Trees
          6. 14.7.6. Lambda Expressions and Collections
        8. 14.8. SUMMARY
    8. II. Windows Programming
      1. 15. Basic Windows Programming
        1. 15.1. CONTROLS
          1. 15.1.1. Properties
          2. 15.1.2. Anchoring, Docking, and Snapping Controls
          3. 15.1.3. Anchor and Dock Properties
          4. 15.1.4. Events
        2. 15.2. THE BUTTON CONTROL
          1. 15.2.1. Button Properties
          2. 15.2.2. Button Events
          3. 15.2.3. Adding the Event Handlers
        3. 15.3. THE LABEL AND LINKLABEL CONTROLS
        4. 15.4. THE TEXTBOX CONTROL
          1. 15.4.1. TextBox Properties
          2. 15.4.2. TextBox Events
          3. 15.4.3. Adding the Event Handlers
        5. 15.5. THE RADIOBUTTON AND CHECKBOX CONTROLS
          1. 15.5.1. RadioButton Properties
          2. 15.5.2. RadioButton Events
          3. 15.5.3. CheckBox Properties
          4. 15.5.4. CheckBox Events
          5. 15.5.5. The GroupBox Control
        6. 15.6. THE RICHTEXTBOX CONTROL
          1. 15.6.1. RichTextBox Properties
          2. 15.6.2. RichTextBox Events
        7. 15.7. THE LISTBOX AND CHECKEDLISTBOX CONTROLS
          1. 15.7.1. ListBox Properties
          2. 15.7.2. ListBox Methods
          3. 15.7.3. ListBox Events
        8. 15.8. THE LISTVIEW CONTROL
          1. 15.8.1. ListView Properties
          2. 15.8.2. ListView Methods
          3. 15.8.3. ListView Events
          4. 15.8.4. ListViewItem
          5. 15.8.5. ColumnHeader
          6. 15.8.6. The ImageList Control
        9. 15.9. THE TABCONTROL CONTROL
          1. 15.9.1. TabControl Properties
          2. 15.9.2. Working with the TabControl
        10. 15.10. SUMMARY
      2. 16. Advanced Windows Forms Features
        1. 16.1. MENUS AND TOOLBARS
          1. 16.1.1. Two Is One
          2. 16.1.2. Using the MenuStrip Control
          3. 16.1.3. Creating Menus Manually
          4. 16.1.4. Properties of the ToolStripMenuItem
          5. 16.1.5. Adding Functionality to Menus
        2. 16.2. TOOLBARS
          1. 16.2.1. ToolStrip Properties
          2. 16.2.2. ToolStrip Items
          3. 16.2.3. Adding Event Handlers
          4. 16.2.4. StatusStrip
          5. 16.2.5. StatusStripStatusLabel Properties
        3. 16.3. SDI AND MDI Applications
        4. 16.4. BUILDING MDI APPLICATIONS
        5. 16.5. CREATING CONTROLS
          1. 16.5.1. Adding Properties
          2. 16.5.2. Adding the Event Handlers
          3. 16.5.3. Debugging User Controls
          4. 16.5.4. Extending the LabelTextbox Control
            1. 16.5.4.1. Adding More Properties
            2. 16.5.4.2. Adding More Event Handlers
            3. 16.5.4.3. Adding a Custom Event Handler
        6. 16.6. SUMMARY
      3. 17. Deploying Windows Applications
        1. 17.1. DEPLOYMENT OVERVIEW
        2. 17.2. CLICKONCE DEPLOYMENT
          1. 17.2.1. Creating the ClickOnce Deployment
          2. 17.2.2. Installing the Application with ClickOnce
          3. 17.2.3. Creating and Using Updates of the Application
        3. 17.3. VISUAL STUDIO SETUP AND DEPLOYMENT PROJECT TYPES
        4. 17.4. MICROSOFT WINDOWS INSTALLER ARCHITECTURE
          1. 17.4.1. Windows Installer Terms
          2. 17.4.2. Advantages of the Windows Installer
        5. 17.5. CREATING AN INSTALLATION PACKAGE FOR THE MDI EDITOR
          1. 17.5.1. Planning the Installation
          2. 17.5.2. Creating the Project
          3. 17.5.3. Project Properties
            1. 17.5.3.1. Packaging
            2. 17.5.3.2. Prerequisites
            3. 17.5.3.3. Setup Editors
          4. 17.5.4. File System Editor
            1. 17.5.4.1. Adding Items to Special Folders
            2. 17.5.4.2. File Properties
          5. 17.5.5. File Types Editor
            1. 17.5.5.1. Create Actions
          6. 17.5.6. Launch Condition Editor
          7. 17.5.7. User Interface Editor
            1. 17.5.7.1. Additional Dialogs
        6. 17.6. BUILDING THE PROJECT
        7. 17.7. INSTALLATION
          1. 17.7.1. Welcome
          2. 17.7.2. Read Me
          3. 17.7.3. License Agreement
          4. 17.7.4. Optional Files
          5. 17.7.5. Select Installation Folder
            1. 17.7.5.1. Disk Cost
          6. 17.7.6. Confirm Installation
          7. 17.7.7. Progress
          8. 17.7.8. Installation Complete
          9. 17.7.9. Running the Application
          10. 17.7.10. Uninstall
        8. 17.8. SUMMARY
    9. III. Web Programming
      1. 18. ASP.NET Web Programming
        1. 18.1. OVERVIEW OF WEB APPLICATIONS
        2. 18.2. ASP.NET RUNTIME
        3. 18.3. CREATING A SIMPLE PAGE
        4. 18.4. SERVER CONTROLS
        5. 18.5. ASP.NET POSTBACK
        6. 18.6. ASP.NET AJAX POSTBACK
        7. 18.7. INPUT VALIDATION
        8. 18.8. STATE MANAGEMENT
          1. 18.8.1. Client-Side State Management
            1. 18.8.1.1. View State
            2. 18.8.1.2. Cookies
          2. 18.8.2. Server-Side State Management
            1. 18.8.2.1. Session
            2. 18.8.2.2. Application
            3. 18.8.2.3. Cache
        9. 18.9. STYLES
        10. 18.10. MASTER PAGES
        11. 18.11. SITE NAVIGATION
        12. 18.12. AUTHENTICATION AND AUTHORIZATION
          1. 18.12.1. Authentication Configuration
          2. 18.12.2. Using Security Controls
        13. 18.13. READING FROM AND WRITING TO A SQL SERVER DATABASE
        14. 18.14. SUMMARY
      2. 19. Web Services
        1. 19.1. WHERE TO USE WEB SERVICES
          1. 19.1.1. A Hotel Travel Agency Application Scenario
          2. 19.1.2. A Book Distributor Application Scenario
          3. 19.1.3. Client Application Types
        2. 19.2. APPLICATION ARCHITECTURE
        3. 19.3. WEB SERVICES ARCHITECTURE
          1. 19.3.1. Calling Methods and the Web Services Description Language
          2. 19.3.2. Calling a Method
          3. 19.3.3. WS-I Basic Profile
        4. 19.4. WEB SERVICES AND THE .NET FRAMEWORK
          1. 19.4.1. Creating a Web Service
            1. 19.4.1.1. WebService Attribute
            2. 19.4.1.2. WebMethod Attribute
            3. 19.4.1.3. WebServiceBinding Attribute
          2. 19.4.2. Client
            1. 19.4.2.1. SoapHttpClientProtocol
            2. 19.4.2.2. Alternative Client Protocols
        5. 19.5. CREATING A SIMPLE ASP.NET WEB SERVICE
          1. 19.5.1. Adding a Web Method
        6. 19.6. TESTING THE WEB SERVICE
        7. 19.7. IMPLEMENTING A WINDOWS CLIENT
        8. 19.8. CALLING THE SERVICE ASYNCHRONOUSLY
        9. 19.9. IMPLEMENTING AN ASP.NET CLIENT
        10. 19.10. PASSING DATA
        11. 19.11. SUMMARY
      3. 20. Deploying Web Applications
        1. 20.1. INTERNET INFORMATION SERVICES
        2. 20.2. IIS CONFIGURATION
        3. 20.3. COPYING A WEBSITE
        4. 20.4. PUBLISHING A WEB APPLICATION
        5. 20.5. WINDOWS INSTALLER
          1. 20.5.1. Creating a Setup Program
          2. 20.5.2. Installing the Web Application
        6. 20.6. SUMMARY
    10. IV. Data Access
      1. 21. File System Data
        1. 21.1. STREAMS
        2. 21.2. THE CLASSES FOR INPUT AND OUTPUT
          1. 21.2.1. The File and Directory Classes
          2. 21.2.2. The FileInfo Class
          3. 21.2.3. The DirectoryInfo Class
          4. 21.2.4. Path Names and Relative Paths
          5. 21.2.5. The FileStream Object
            1. 21.2.5.1. File Position
            2. 21.2.5.2. Reading Data
            3. 21.2.5.3. Writing Data
          6. 21.2.6. The StreamWriter Object
          7. 21.2.7. The StreamReader Object
            1. 21.2.7.1. Reading Data
            2. 21.2.7.2. Delimited Files
          8. 21.2.8. Reading and Writing Compressed Files
        3. 21.3. SERIALIZED OBJECTS
        4. 21.4. MONITORING THE FILE SYSTEM
        5. 21.5. SUMMARY
      2. 22. XML
        1. 22.1. XML DOCUMENTS
          1. 22.1.1. XML Elements
          2. 22.1.2. Attributes
          3. 22.1.3. The XML Declaration
          4. 22.1.4. Structure of an XML Document
          5. 22.1.5. XML Namespaces
          6. 22.1.6. Well-Formed and Valid XML
          7. 22.1.7. Validating XML Documents
            1. 22.1.7.1. DTDs
            2. 22.1.7.2. Schemas
              1. 22.1.7.2.1. XDR Schemas
              2. 22.1.7.2.2. XSD Schemas
        2. 22.2. USING XML IN YOUR APPLICATION
          1. 22.2.1. XML Document Object Model
            1. 22.2.1.1. XmlDocument Class
            2. 22.2.1.2. XmlElement Class
            3. 22.2.1.3. Changing the Values of Nodes
              1. 22.2.1.3.1. Inserting New Nodes
              2. 22.2.1.3.2. Deleting Nodes
          2. 22.2.2. Selecting Nodes
          3. 22.2.3. XPath
        3. 22.3. SUMMARY
      3. 23. Introduction to LINQ
        1. 23.1. FIRST LINQ QUERY
          1. 23.1.1. Declaring a Variable for Results Using the var Keyword
          2. 23.1.2. Specify Data Source: from Clause
          3. 23.1.3. Specify Condition: where Clause
          4. 23.1.4. Select Items: select Clause
          5. 23.1.5. Finishing Up: Using the foreach Loop
          6. 23.1.6. Deferred Query Execution
        2. 23.2. USING THE LINQ METHOD SYNTAX
          1. 23.2.1. LINQ Extension Methods
          2. 23.2.2. Query Syntax versus Method Syntax
        3. 23.3. ORDERING QUERY RESULTS
        4. 23.4. ORDERBY CLAUSE
        5. 23.5. ORDERING USING METHOD SYNTAX
        6. 23.6. QUERYING A LARGE DATA SET
        7. 23.7. AGGREGATE OPERATORS
        8. 23.8. QUERYING COMPLEX OBJECTS
        9. 23.9. PROJECTION: CREATING NEW OBJECTS IN QUERIES
        10. 23.10. PROJECTION: METHOD SYNTAX
        11. 23.11. SELECT DISTINCT QUERY
        12. 23.12. ANY AND ALL
        13. 23.13. ORDERING BY MULTIPLE LEVELS
        14. 23.14. MULTI-LEVEL ORDERING METHOD SYNTAX: THENBY
        15. 23.15. GROUP QUERIES
        16. 23.16. TAKE AND SKIP
        17. 23.17. FIRST AND FIRSTORDEFAULT
        18. 23.18. SET OPERATORS
        19. 23.19. JOINS
        20. 23.20. SUMMARY
      4. 24. Applying LINQ
        1. 24.1. LINQ VARIETIES
        2. 24.2. USING LINQ WITH DATABASES
        3. 24.3. INSTALLING SQL SERVER AND THE NORTHWIND SAMPLE DATA
          1. 24.3.1. Installing SQL Server Express 2008
          2. 24.3.2. Installing the Northwind Sample Database
        4. 24.4. FIRST LINQ TO DATABASE QUERY
        5. 24.5. NAVIGATING DATABASE RELATIONSHIPS
        6. 24.6. USING LINQ WITH XML
        7. 24.7. LINQ TO XML FUNCTIONAL CONSTRUCTORS
          1. 24.7.1. Constructing XML Element Text with Strings
        8. 24.8. SAVING AND LOADING AN XML DOCUMENT
          1. 24.8.1. Loading XML from a String
          2. 24.8.2. Contents of a Saved XML Document
        9. 24.9. WORKING WITH XML FRAGMENTS
        10. 24.10. GENERATING XML FROM DATABASES
        11. 24.11. HOW TO QUERY AN XML DOCUMENT
        12. 24.12. USING LINQ TO XML QUERY MEMBERS
          1. 24.12.1. Elements()
          2. 24.12.2. Descendants()
          3. 24.12.3. Attributes()
        13. 24.13. SUMMARY
    11. V. Additional Techniques
      1. 25. Windows Presentation Foundation
        1. 25.1. WHAT IS WPF?
          1. 25.1.1. WPF for Designers
          2. 25.1.2. WPF for C# Developers
        2. 25.2. ANATOMY OF A BASIC WPF APPLICATION
        3. 25.3. WPF FUNDAMENTALS
          1. 25.3.1. XAML Syntax
            1. 25.3.1.1. Object Element Syntax
            2. 25.3.1.2. Attribute Syntax
            3. 25.3.1.3. Property Element Syntax
            4. 25.3.1.4. Content Syntax
            5. 25.3.1.5. Mixing Property Element Syntax and Content Syntax
            6. 25.3.1.6. Markup Extensions
          2. 25.3.2. Desktop and Web Applications
          3. 25.3.3. The Application Object
          4. 25.3.4. Control Basics
            1. 25.3.4.1. Dependency Properties
            2. 25.3.4.2. Attached Properties
            3. 25.3.4.3. Routed Events
            4. 25.3.4.4. Attached Events
          5. 25.3.5. Control Layout
            1. 25.3.5.1. Stack Order
            2. 25.3.5.2. Alignment, Margins, Padding, and Dimensions
            3. 25.3.5.3. Border
            4. 25.3.5.4. Canvas
            5. 25.3.5.5. DockPanel
            6. 25.3.5.6. Grid
            7. 25.3.5.7. StackPanel
            8. 25.3.5.8. WrapPanel
          6. 25.3.6. Control Styling
            1. 25.3.6.1. Styles
            2. 25.3.6.2. Templates
          7. 25.3.7. Triggers
          8. 25.3.8. Animation
            1. 25.3.8.1. Timelines without Key Frames
            2. 25.3.8.2. Timelines with Key Frames
          9. 25.3.9. Static and Dynamic Resources
            1. 25.3.9.1. Static Resources
            2. 25.3.9.2. Dynamic Resources
            3. 25.3.9.3. Referencing Style Resources
        4. 25.4. PROGRAMMING WITH WPF
          1. 25.4.1. WPF User Controls
          2. 25.4.2. Implementing Dependency Properties
        5. 25.5. SUMMARY
      2. 26. Windows Communication Foundation
        1. 26.1. WHAT IS WCF?
        2. 26.2. WCF CONCEPTS
          1. 26.2.1. WCF Communication Protocols
          2. 26.2.2. Addresses, Endpoints, and Bindings
          3. 26.2.3. Contracts
          4. 26.2.4. Message Patterns
          5. 26.2.5. Behaviors
          6. 26.2.6. Hosting
        3. 26.3. WCF PROGRAMMING
          1. 26.3.1. The WCF Test Client
          2. 26.3.2. Defining WCF Service Contracts
            1. 26.3.2.1. Data Contracts
            2. 26.3.2.2. Service Contracts
            3. 26.3.2.3. Operation Contracts
            4. 26.3.2.4. Message Contracts
            5. 26.3.2.5. Fault Contracts
          3. 26.3.3. Self-Hosted WCF Services
        4. 26.4. SUMMARY
      3. 27. Windows Workflow Foundation
        1. 27.1. HELLO WORLD
        2. 27.2. WORKFLOWS AND ACTIVITIES
          1. 27.2.1. If Activity
          2. 27.2.2. While Activity
          3. 27.2.3. Sequence Activity
        3. 27.3. ARGUMENTS AND VARIABLES
        4. 27.4. CUSTOM ACTIVITIES
          1. 27.4.1. Workflow Extensions
          2. 27.4.2. Activity Validation
          3. 27.4.3. Activity Designers
        5. 27.5. SUMMARY
    12. A. Exercise Solutions
      1. A.1. CHAPTER 3 SOLUTIONS
        1. A.1.1. Exercise 1
        2. A.1.2. Exercise 2
        3. A.1.3. Exercise 3
        4. A.1.4. Exercise 4
        5. A.1.5. Exercise 5
      2. A.2. CHAPTER 4 SOLUTIONS
        1. A.2.1. Exercise 1
        2. A.2.2. Exercise 2
        3. A.2.3. Exercise 3
        4. A.2.4. Exercise 4
      3. A.3. CHAPTER 5 SOLUTIONS
        1. A.3.1. Exercise 1
        2. A.3.2. Exercise 2
        3. A.3.3. Exercise 3
        4. A.3.4. Exercise 4
        5. A.3.5. Exercise 5
        6. A.3.6. Exercise 6
        7. A.3.7. Exercise 7
      4. A.4. CHAPTER 6 SOLUTIONS
        1. A.4.1. Exercise 1
        2. A.4.2. Exercise 2
        3. A.4.3. Exercise 3
        4. A.4.4. Exercise 4
        5. A.4.5. Exercise 5
      5. A.5. CHAPTER 7 SOLUTIONS
        1. A.5.1. Exercise 1
        2. A.5.2. Exercise 2
        3. A.5.3. Exercise 3
        4. A.5.4. Exercise 4
      6. A.6. CHAPTER 8 SOLUTIONS
        1. A.6.1. Exercise 1
        2. A.6.2. Exercise 2
        3. A.6.3. Exercise 3
        4. A.6.4. Exercise 4
        5. A.6.5. Exercise 5
      7. A.7. CHAPTER 9 SOLUTIONS
        1. A.7.1. Exercise 1
        2. A.7.2. Exercise 2
        3. A.7.3. Exercise 3
        4. A.7.4. Exercise 4
        5. A.7.5. Exercise 5
      8. A.8. CHAPTER 10 SOLUTIONS
        1. A.8.1. Exercise 1
        2. A.8.2. Exercise 2
        3. A.8.3. Exercise 3
        4. A.8.4. Exercise 4
        5. A.8.5. Exercise 5
      9. A.9. CHAPTER 11 SOLUTIONS
        1. A.9.1. Exercise 1
        2. A.9.2. Exercise 2
        3. A.9.3. Exercise 3
        4. A.9.4. Exercise 4
        5. A.9.5. Exercise 5
      10. A.10. CHAPTER 12 SOLUTIONS
        1. A.10.1. Exercise 1
        2. A.10.2. Exercise 2
        3. A.10.3. Exercise 3
        4. A.10.4. Exercise 4
        5. A.10.5. Exercise 5
        6. A.10.6. Exercise 6
      11. A.11. CHAPTER 13 SOLUTIONS
        1. A.11.1. Exercise 1
        2. A.11.2. Exercise 2
      12. A.12. CHAPTER 14 SOLUTIONS
        1. A.12.1. Exercise 1
        2. A.12.2. Exercise 2
        3. A.12.3. Exercise 3
        4. A.12.4. Exercise 4
        5. A.12.5. Exercise 5
        6. A.12.6. Exercise 6
      13. A.13. CHAPTER 15 SOLUTIONS
        1. A.13.1. Exercise 1
        2. A.13.2. Exercise 2
        3. A.13.3. Exercise 3
      14. A.14. CHAPTER 16 SOLUTIONS
        1. A.14.1. Exercise 1
        2. A.14.2. Exercise 2
      15. A.15. CHAPTER 17 SOLUTIONS
        1. A.15.1. Exercise 1
        2. A.15.2. Exercise 2
        3. A.15.3. Exercise 3
        4. A.15.4. Exercise 4
      16. A.16. CHAPTER 18 SOLUTIONS
        1. A.16.1. Exercise 1
        2. A.16.2. Exercise 2
        3. A.16.3. Exercise 3
      17. A.17. CHAPTER 19 SOLUTIONS
        1. A.17.1. Exercise 1
        2. A.17.2. Exercise 2
        3. A.17.3. Exercise 3
        4. A.17.4. Exercise 4
      18. A.18. CHAPTER 20 SOLUTIONS
        1. A.18.1. Exercise 1
        2. A.18.2. Exercise 2
        3. A.18.3. Exercise 3
        4. A.18.4. Exercise 4
      19. A.19. CHAPTER 21 SOLUTIONS
        1. A.19.1. Exercise 1
        2. A.19.2. Exercise 2
        3. A.19.3. Exercise 3
        4. A.19.4. Exercise 4
        5. A.19.5. Exercise 5
        6. A.19.6. Exercise 6
        7. A.19.7. Exercise 7
      20. A.20. CHAPTER 22 SOLUTIONS
        1. A.20.1. Exercise 1
        2. A.20.2. Exercise 2
        3. A.20.3. Exercise 3
      21. A.21. CHAPTER 23 SOLUTIONS
        1. A.21.1. Exercise 1
        2. A.21.2. Exercise 2
        3. A.21.3. Exercise 3
        4. A.21.4. Exercise 4
        5. A.21.5. Exercise 5
        6. A.21.6. Exercise 6
        7. A.21.7. Exercise 7
      22. A.22. CHAPTER 24 SOLUTIONS
        1. A.22.1. Exercise 1
        2. A.22.2. Exercise 2
        3. A.22.3. Exercise 3
        4. A.22.4. Exercise 4
        5. A.22.5. Exercise 5
        6. A.22.6. Exercise 6
        7. A.22.7. Exercise 7
      23. A.23. CHAPTER 25 SOLUTIONS
        1. A.23.1. Exercise 1
        2. A.23.2. Exercise 2
        3. A.23.3. Exercise 3
        4. A.23.4. Exercise 4
        5. A.23.5. Exercise 5
        6. A.23.6. Exercise 6
        7. A.23.7. Exercise 7
      24. A.24. CHAPTER 26 SOLUTIONS
        1. A.24.1. Exercise 1
        2. A.24.2. Exercise 2
        3. A.24.3. Exercise 3
        4. A.24.4. Exercise 4
        5. A.24.5. Exercise 5
      25. A.25. Answers to CHAPTER 27 EXERCISES
        1. A.25.1. Exercise 1
        2. A.25.2. Exercise 2
        3. A.25.3. Exercise 3