Troelsen / Vrat Agarwal | Pro VB 2010 and the .NET 4.0 Platform | E-Book | www2.sack.de
E-Book

E-Book, Englisch, 1800 Seiten

Troelsen / Vrat Agarwal Pro VB 2010 and the .NET 4.0 Platform


1. ed
ISBN: 978-1-4302-2986-5
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

E-Book, Englisch, 1800 Seiten

ISBN: 978-1-4302-2986-5
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



Be the first to understand .NET 4.0 and Visual Basic 2010. Pro VB 2010 and the .NET 4.0 Platform provides developers with a complete guide to the new technology, explaining the importance of all the key VB 2010 language features. This edition has been comprehensively revised and rewritten to make it accurately reflect the VB 10 language specification for the .NET 4.0 platform. You'll find new chapters covering the important concepts of dynamic lookups, named and optional arguments, Parallel LINQ (PLINQ), improved COM interop, and variance for generics. The first edition of this book was released at the 2001 Tech-Ed conference in Atlanta, Georgia. At that time, the .NET platform was still a beta product, and in many ways, so was this book. This is not to say that the early editions of this text did not have merit-after all, the book was a 2002 Jolt Award finalist and it won the 2003 Referenceware Excellence Award. However, over the years that author Andrew Troelsen spent working with the common language runtime (CLR), he gained a much deeper understanding of the .NET platform and the subtleties of the VB programming language, and he feels that this sixth edition of the book is as close to a 'final release' as he's come yet! If you're checking out this book for the first time, do understand that it's targeted at experienced software professionals and/or graduate students of computer science (so don't expect three chapters on iteration or decision constructs!). The mission of this text is to provide you with a rock-solid foundation in the VB programming language and the core aspects of the .NET platform (assemblies, remoting, Windows Forms, Web Forms, ADO.NET, XML web services, etc.). Once you digest the information presented in these 25 chapters, you'll be in a perfect position to apply this knowledge to your specific programming assignments and explore the .NET universe on your own terms.

Andrew Troelsen is a partner, trainer, and consultant at Intertech Inc., and is a leading authority on both .NET and COM. His book Pro C# 2005 and the .NET 2.0 Platform won the prestigious 2003 Referenceware Excellence Award and is in its third edition. Also of note are his earlier five-star treatment of traditional COM in the bestselling Developer's Workshop to COM and ATL mirrored in his book, COM and .NET Interoperability, and his top-notch investigation of VB .NET in Visual Basic .NET and the .NET Platform: An Advanced Guide. Troelsen has a degree in mathematical linguistics and South Asian studies from the University of Minnesota, and is a frequent speaker at numerous .NET-related conferences. He currently lives in Minneapolis with his wife, Amanda, and spends his free time investigating .NET and waiting for the Wild to win the Stanley Cup. You can check out his blog at AndrewTroelsen.blogspot.com.

Troelsen / Vrat Agarwal Pro VB 2010 and the .NET 4.0 Platform jetzt bestellen!

Weitere Infos & Material


1;Title Page;1
2;Copyright Page;2
3;Contents at a Glance;4
4;Table of Contents;6
5;About the Authors;54
6;About the Technical Reviewer;55
7;Acknowledgments;56
8;Introduction;57
8.1;We’re a Team, You and I;57
8.2;An Overview of This Book;58
8.2.1;Chapter 1: Introducing VB 2010;58
8.2.2;Chapter 2: Building Visual Basic 2010 Applications;58
8.2.3;Chapter 3: Core VB 2010 Programming Constructs, Part I;58
8.2.4;Chapter 4: Core VB Programming Constructs, Part II;58
8.2.5;Chapter 5: Defining Encapsulated Class Types;59
8.2.6;Chapter 6: Understanding Inheritance and Polymorphism;59
8.2.7;Chapter 7: Understanding Structured Exception Handling;59
8.2.8;Chapter 8: Understanding Object Lifetime;59
8.2.9;Chapter 9: Working with Interfaces;59
8.2.10;Chapter 10: Understanding Generics;60
8.2.11;Chapter 11: Delegates, Events, and Lambdas;60
8.2.12;Chapter 12: Advanced VB 2010 Language Features;60
8.2.13;Chapter 13: LINQ to Objects;60
8.2.14;Chapter 14: Configuring .NET Assemblies;60
8.2.15;Chapter 15: Type Reflection, Late Binding, and Attribute-BasedProgramming;61
8.2.16;Chapter 16: Processes, AppDomains, and Object Contexts;61
8.2.17;Chapter 17: Understanding CIL and the Role of DynamicAssemblies;61
8.2.18;Chapter 18: Dynamic Types and the Dynamic Language Runtime;61
8.2.19;Chapter 19: Multithreaded and Parallel Programming;61
8.2.20;Chapter 20: File I/O and Object Serialization;62
8.2.21;Chapter 21: ADO.NET Part I: The Connected Layer;62
8.2.22;Chapter 22: ADO.NET Part II: The Disconnected Layer;62
8.2.23;Chapter 23: ADO.NET Part III: The Entity Framework;62
8.2.24;Chapter 24: Introducing LINQ to XML;63
8.2.25;Chapter 25: Introducing Windows Communication Foundation;63
8.2.26;Chapter 26: Introducing Windows Workflow Foundation;63
8.2.27;Chapter 27: Introducing Windows Presentation Foundation andXAML;63
8.2.28;Chapter 28: Programming with WPF Controls;64
8.2.29;Chapter 29: WPF Graphical Rendering Services;64
8.2.30;Chapter 30: WPF Resources, Animations, and Styles;64
8.2.31;Chapter 31: WPF Control Templates and UserControls;64
8.2.32;Chapter 32: Building ASP.NET Web Pages;64
8.2.33;Chapter 33: ASP.NET Web Controls, Master Pages, and Themes;65
8.2.34;Chapter 34: ASP.NET State Management Techniques;65
8.2.35;Appendix A: Programming with Windows Forms;65
8.2.36;Appendix B: Platform-Independent .NET Development with Mono;65
8.3;Obtaining This Book’s Source Code;65
8.4;Obtaining Updates for This Book;66
9;Chapter 1: Introducing VB 2010;67
9.1;Understanding the Previous State of Affairs;67
9.1.1;Life As a C/Windows API Programmer;67
9.1.2;Life As a C++/MFC Programmer;68
9.1.3;Life As a Visual Basic 6.0 Programmer;68
9.1.4;Life As a Java Programmer;69
9.1.5;Life As a COM Programmer;69
9.1.5.1;The Complexity of COM Data Type Representation;70
9.2;The .NET Solution;70
9.3;Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS);71
9.3.1;The Role of the Base Class Libraries;72
9.3.2;What Visual Basic 2010 Brings to the Table;72
9.4;Additional .NET-Aware Programming Languages;74
9.4.1;Life in a Multi-Language World;76
9.5;An Overview of .NET Assemblies;76
9.5.1;Single-File and Multi-File Assemblies;78
9.5.2;The Role of the Common Intermediate Language;78
9.5.2.1;Benefits of CIL;81
9.5.2.2;Compiling CIL to Platform-Specific Instructions;81
9.5.3;The Role of .NET Type Metadata;81
9.5.4;The Role of the Assembly Manifest;83
9.6;Understanding the Common Type System;84
9.6.1;CTS Class Types;84
9.6.2;CTS Interface Types;85
9.6.3;CTS Structure Types;85
9.6.4;CTS Enumeration Types;86
9.6.5;CTS Delegate Types;86
9.6.6;CTS Type Members;87
9.6.7;Intrinsic CTS Data Types;87
9.7;Understanding the Common Language Specification;88
9.7.1;Ensuring CLS Compliance;90
9.8;Understanding the Common Language Runtime;90
9.9;The Assembly/Namespace/Type Distinction;92
9.9.1;The Role of the Microsoft Root Namespace;95
9.9.2;Accessing a Namespace Programmatically;95
9.9.3;Referencing External Assemblies;97
9.10;Exploring an Assembly Using ildasm.exe;98
9.10.1;Viewing CIL Code;99
9.10.2;Viewing Type Metadata;100
9.10.3;Viewing Assembly Metadata (aka the Manifest);100
9.11;Exploring an Assembly Using Reflector;101
9.12;Deploying the .NET Runtime;103
9.12.1;The .NET Client Profile Runtime;103
9.13;The Platform-Independent Nature of .NET;103
9.14;Summary;105
10;Chapter 2: Building Visual Basic 2010 Applications;106
10.1;The Role of the .NET Framework 4.0 SDK;106
10.1.1;The Visual Studio 2010 Command Prompt;107
10.2;Building VB 2010 Applications Using vbc.exe;108
10.2.1;Specifying Input and Output Targets;109
10.2.2;Referencing External Assemblies;110
10.2.3;Referencing Multiple External Assemblies;111
10.2.4;Compiling Multiple Source Files;111
10.2.5;Working with VB 2010 Response Files;112
10.2.5.1;The Default Response File (vbc.rsp);113
10.3;Building .NET Applications Using Notepad++;114
10.4;Building .NET Applications Using Visual Basic 2010 Express;115
10.4.1;Some Unique Features of Visual Basic 2010 Express;116
10.5;Building .NET Applications Using Visual Studio 2010;117
10.5.1;Some Unique Features of Visual Studio 2010;118
10.5.2;Targeting the .NET Framework Using the New Project Dialog Box;118
10.5.3;Using the Solution Explorer Utility;119
10.5.3.1;Referencing External Assemblies;120
10.5.3.2;Viewing Project Properties;121
10.5.4;The Class View Utility;122
10.5.5;The Object Browser Utility;123
10.5.6;Integrated Support for Code Refactoring;124
10.5.7;Code Expansions Techniques;126
10.5.8;The Visual Class Designer;127
10.5.9;The Integrated .NET Framework 4.0 SDK Documentation System;133
10.6;Summary;135
11;Chapter 3: Core VB 2010 Programming Constructs, Part I;136
11.1;The Role of the Module Type;136
11.1.1;Projects with Multiple Modules;138
11.1.2;Modules Are Not Creatable;139
11.1.3;Renaming Your Initial Module;140
11.1.4;Members of Modules;140
11.2;The Anatomy of a Simple VB 2010 Program;141
11.2.1;Variations on the Main() Method;142
11.2.2;Specifying an Application Error Code;143
11.2.3;Processing Command-Line Arguments;145
11.2.4;Specifying Command-Line Arguments with Visual Studio 2010;146
11.3;An Interesting Aside: Some Additional Members of the System.Environment Class;147
11.4;The System.Console Class;149
11.4.1;Basic Input and Output with the Console Class;150
11.4.2;Formatting Console Output;151
11.4.3;Formatting Numerical Data;151
11.4.4;Formatting Numerical Data Beyond Console Applications;153
11.5;System Data Types and VB 2010 Shorthand Notation;154
11.5.1;Variable Declaration and Initialization;156
11.5.2;Intrinsic Data Types and the New Operator;157
11.5.3;The Data Type Class Hierarchy;158
11.5.4;Members of Numerical Data Types;160
11.5.5;Members of System.Boolean;161
11.5.6;Members of System.Char;161
11.5.7;Parsing Values from String Data;162
11.5.8;System.DateTime and System.TimeSpan;163
11.5.9;The .NET 4.0 System.Numerics Namespace;163
11.6;Working with String Data;165
11.6.1;Basic String Manipulation;166
11.6.2;String Concatenation;167
11.6.3;Special Character Constants;168
11.6.4;End SubStrings and Equality;169
11.6.5;Strings Are Immutable;170
11.6.6;The System.Text.StringBuilder Type;171
11.7;Narrowing and Widening Data Type Conversions;173
11.7.1;Trapping Narrowing Data Conversions;176
11.7.2;Understanding Option Strict;177
11.7.3;Setting Project-wide Overflow Checking;178
11.7.4;The Role of System.Convert;179
11.8;Understanding Implicitly Typed Local Variables;180
11.8.1;Restrictions on Implicitly Typed Variables;181
11.8.2;Implicit Typed Data Is Strongly Typed Data;182
11.8.3;Usefulness of Implicitly Typed Local Variables;183
11.9;VB 2010 Iteration Constructs;183
11.9.1;The For Loop;184
11.9.2;The For Each Loop;184
11.9.2.1;Use of Implicitly Typed Variables Within For Each Constructs;185
11.9.3;The While and Do/While Looping Constructs;185
11.10;Decision Constructs and the Relational/Equality Operators;186
11.10.1;The If/Then/Else Statement;186
11.10.2;The Select/Case Statement;188
11.11;Summary;189
12;Chapter 4: Core VB 2010 Programming Constructs, Part II;190
12.1;Methods and Parameter Modifiers;190
12.1.1;The ByVal Parameter Modifier;191
12.1.2;The ByRef Modifier;193
12.1.3;The Attribute;194
12.1.4;The ParamArray Modifier;195
12.1.5;Defining Optional Parameters;197
12.1.6;Invoking Methods using Named Parameters;198
12.1.7;Understanding Method Overloading;200
12.2;Understanding VB 2010 Arrays;203
12.2.1;VB 2010 Array Initialization Syntax;204
12.2.2;Implicitly Typed Local Arrays;204
12.2.3;Defining an Array of Objects;205
12.2.4;Working with Multidimensional Arrays;206
12.2.5;Arrays As Arguments or Return Values;208
12.2.6;The System.Array Base Class;209
12.3;Understanding the Enum Type;211
12.3.1;Controlling the Underlying Storage for an Enum;212
12.3.2;Declaring Enum Variables;212
12.3.3;The System.Enum Type;213
12.3.4;Dynamically Discovering an Enum’s Name/Value Pairs;214
12.4;Understanding the Structure Type;217
12.4.1;Creating Structure Variables;218
12.5;Understanding Value Types and Reference Types;220
12.5.1;Value Types, References Types, and the Assignment Operator;221
12.5.2;Value Types Containing Reference Types;223
12.5.3;Passing Reference Types by Value;225
12.5.4;Passing Reference Types by Reference;227
12.5.5;Final Details Regarding Value Types and Reference Types;228
12.6;Understanding VB 2010 Nullable Types;229
12.6.1;Working with Nullable Types;230
12.6.2;The Nullable If Operator;231
12.7;Summary;232
13;Chapter 5: Defining Encapsulated Class Types;233
13.1;Introducing the VB 2010 Class Type;233
13.1.1;Allocating Objects with the New Keyword;236
13.2;Understanding Constructors;237
13.2.1;The Role of the Default Constructor;237
13.2.2;Defining Custom Constructors;238
13.2.3;The Default Constructor Revisited;239
13.3;The Role of the Me Keyword;240
13.3.1;Chaining Constructor Calls Using Me;242
13.3.2;Observing Constructor Flow;245
13.3.3;Revisiting Optional Arguments;247
13.4;Understanding the Shared Keyword;248
13.4.1;Defining Shared Methods;248
13.4.2;Defining Shared Field Data;249
13.4.3;Defining Shared Constructors;252
13.4.4;Defining Modules in VB 2010;254
13.5;Defining the Pillars of OOP;257
13.5.1;The Role of Encapsulation;257
13.5.2;The Role of Inheritance;258
13.5.3;The Role of Polymorphism;259
13.6;VB 2010 Access Modifiers;261
13.6.1;The Default Access Modifiers;261
13.6.2;Access Modifiers and Nested Types;262
13.7;The First Pillar: VB 2010 Encapsulation Services;262
13.7.1;Encapsulation Using Traditional Accessors and Mutators;263
13.7.2;Encapsulation Using .NET Properties;266
13.7.3;Using Properties within a Class Definition;270
13.7.4;Internal Representation of Properties;271
13.7.5;Controlling Visibility Levels of Property Get/Set Statements;274
13.7.6;Read-Only and Write-Only Properties;274
13.7.7;Shared Properties;275
13.8;Understanding Automatic Properties;277
13.8.1;Interacting with Automatic Properties;278
13.8.2;Regarding Automatic Properties and Default Values;279
13.9;Understanding Object Initializer Syntax;281
13.9.1;Calling Custom Constructors with Initialization Syntax;282
13.9.2;Nested Objects;284
13.10;Working with Constant Field Data;285
13.10.1;Understanding Read-Only Fields;286
13.10.2;Shared Read-Only Fields;287
13.11;Understanding Partial Types;288
13.12;Summary;289
14;Chapter 6: Understanding Inheritance and Polymorphism;291
14.1;The Basic Mechanics of Inheritance;291
14.1.1;Specifying the Parent Class of an Existing Class;292
14.1.2;Regarding Multiple Base Classes;294
14.1.3;The NotInheritable Keyword;294
14.2;Revising Visual Studio Class Diagrams;296
14.3;The Second Pillar of OOP: The Details of Inheritance;299
14.3.1;Controlling Base Class Creation with the MyBase Keyword;301
14.3.2;Keeping Family Secrets: The Protected Keyword;303
14.3.3;Adding a NotInheritable Class;304
14.4;Programming for Containment/Delegation;305
14.4.1;Understanding Nested Type Definitions;307
14.5;The Third Pillar of OOP: VB’s Polymorphic Support;309
14.5.1;The Overridable and Overrides Keywords;310
14.5.2;Overriding Overridable Members Using Visual Studio 2010;313
14.5.3;NotOverridable Members;314
14.5.4;Understanding Abstract Classes and the MustInherit Keyword;314
14.5.5;Understanding the Polymorphic Interface;316
14.5.6;Understanding Member Shadowing;321
14.6;Understanding Base Class/Derived Class Casting Rules;323
14.6.1;The VB TryCast Keyword;326
14.6.2;The VB Is Keyword;326
14.7;The Master Parent Class: System.Object;327
14.7.1;Overriding System.Object.ToString();331
14.7.2;Overriding System.Object.Equals();332
14.7.3;Overriding System.Object.GetHashCode();333
14.7.4;Testing Your Modified Person Class;334
14.7.5;The Shared Members of System.Object;335
14.8;Summary;336
15;Chapter 7: Understanding Structured Exception Handling;337
15.1;Ode to Errors, Bugs, and Exceptions;337
15.2;The Role of .NET Exception Handling;338
15.2.1;The Atoms of .NET Exception Handling;339
15.2.2;The System.Exception Base Class;340
15.3;The Simplest Possible Example;341
15.3.1;Throwing a General Exception;344
15.3.2;Catching Exceptions;345
15.4;Configuring the State of an Exception;347
15.4.1;The TargetSite Property;347
15.4.2;The StackTrace Property;348
15.4.3;The HelpLink Property;348
15.4.4;The Data Property;349
15.5;System-Level Exceptions (System.SystemException);352
15.6;Application-Level Exceptions (System.ApplicationException);352
15.6.1;Building Custom Exceptions, Take One;353
15.6.2;Building Custom Exceptions, Take Two;355
15.6.3;Building Custom Exceptions, Take Three;356
15.7;Processing Multiple Exceptions;357
15.7.1;General Catch Statements;359
15.7.2;Rethrowing Exceptions;360
15.7.3;Inner Exceptions;360
15.7.4;The Finally Block;361
15.8;Who Is Throwing What?;362
15.9;The Result of Unhandled Exceptions;362
15.10;Debugging Unhandled Exceptions Using Visual Studio;363
15.11;A Brief Word Regarding Corrupted State Exceptions (CSE);364
15.12;Summary;366
16;Chapter 8: Understanding Object Lifetime;367
16.1;Classes, Objects, and References;367
16.2;The Basics of Object Lifetime;369
16.2.1;The CIL of new;370
16.2.2;Setting Object References to Nothing;371
16.3;The Role of Application Roots;372
16.4;Understanding Object Generations;374
16.5;Concurrent Garbage Collection under .NET 1.0 - 3.5;375
16.5.1;Background Garbage Collection under .NET 4.0;375
16.6;The System.GC Type;376
16.6.1;Forcing a Garbage Collection;377
16.7;Building Finalizable Objects;380
16.7.1;Overriding System.Object.Finalize();381
16.7.2;Detailing the Finalization Process;383
16.8;Building Disposable Objects;384
16.8.1;Using Keyword with VB 2010;386
16.9;Building Finalizable and Disposable Types;388
16.9.1;A Formalized Disposal Pattern;389
16.10;Understanding Lazy Object Instantiation;391
16.10.1;Customizing the Creation of the Lazy Data;394
16.11;Summary;395
17;Chapter 9: Working with Interfaces;396
17.1;Understanding Interface Types;396
17.1.1;Interface Types vs. Abstract Base Classes;398
17.2;Defining Custom Interfaces;400
17.3;Implementing an Interface;402
17.4;Invoking Interface Members at the Object Level;405
17.4.1;Obtaining Interface References: The TryCast Keyword;406
17.4.2;Obtaining Interface References: The Is Keyword;406
17.5;Interfaces As Parameters;408
17.6;Interfaces As Return Values;411
17.7;Arrays of Interface Types;411
17.8;Implementing Interfaces Using Visual Studio 2010;413
17.9;Resolving Name Clashes via Explicit Interface Implementation;414
17.10;Designing Interface Hierarchies;417
17.10.1;Multiple Inheritance with Interface Types;419
17.11;Building Enumerable Types (IEnumerable and IEnumerator);421
17.12;Building Cloneable Objects (ICloneable);424
17.12.1;A More Elaborate Cloning Example;426
17.13;Building Comparable Objects (IComparable);430
17.13.1;Specifying Multiple Sort Orders (IComparer);434
17.13.2;Custom Properties, Custom Sort Types;436
17.14;Summary;436
18;Chapter 10: Understanding Generics;438
18.1;The Issues with Non-Generic Collections;438
18.1.1;The Issue of Performance;440
18.1.2;The Issue of Type Safety;444
18.2;The Role of Generic Type Parameters;449
18.2.1;Specifying Type Parameters for Generic Classes / Structures;450
18.2.2;Specifying Type Parameters for Generic Members;452
18.2.3;Specifying Type Parameters for Generic Interfaces;452
18.3;The System.Collections.Generic Namespace;454
18.3.1;Understanding Collection Initialization Syntax;455
18.3.2;Working with the List(Of T) Class;457
18.3.3;Working with the Stack(Of T) Class;460
18.3.4;Working with the Queue(Of T) Class;461
18.3.5;Working with the SortedSet(Of T) Class;463
18.4;Creating Custom Generic Methods;465
18.4.1;Inference of Type Parameters;468
18.5;Creating Custom Generic Structures and Classes;469
18.5.1;The Nothing Keyword in Generic Code;470
18.5.2;Generic Base Classes;472
18.6;Constraining Type Parameters;473
18.6.1;Examples Using the As Keyword;474
18.6.2;The Lack of Operator Constraints;475
18.7;Summary;476
19;Chapter 11: Delegates, Events, and Lambdas;478
19.1;Understanding the .NET Delegate Type;478
19.2;Defining a Delegate Type in VB 2010;479
19.3;The System.MulticastDelegate and System.Delegate Base Classes;482
19.4;The Simplest Possible Delegate Example;484
19.4.1;Investigating a Delegate Object;485
19.5;Sending Object State Notifications Using Delegates;487
19.5.1;Enabling Multicasting;491
19.5.2;Removing Targets from a Delegate’s Invocation List;492
19.6;Method Group Conversion Syntax;494
19.7;Understanding Delegate Covariance;495
19.8;Understanding Generic Delegates;498
19.8.1;Simulating Generic Delegates Without Generics;499
19.9;Understanding VB 2010 Events;500
19.9.1;The VB 2010 Event Keyword;502
19.9.2;Events under the Hood;503
19.9.3;Listening to Incoming Events;505
19.9.4;Simplifying Event Registration Using Visual Studio 2010;507
19.9.5;Creating Custom Event Arguments;508
19.9.6;The Generic EventHandler(Of T) Delegate;509
19.10;Understanding VB 2010 Anonymous Methods;510
19.10.1;Accessing Local Variables;512
19.11;Understanding Lambda Expressions;513
19.11.1;Dissecting a Lambda Expression;516
19.11.2;Processing Arguments Within Multiple Statements;517
19.11.3;Lambda Expressions with Multiple (or Zero) Parameters;519
19.11.4;Retrofitting the CarEvents Example Using Lambda Expressions;520
19.12;Summary;522
20;Chapter 12: Advanced VB 2010 Language Features;523
20.1;Understanding Indexer Methods;523
20.1.1;Indexing Data Using String Values;526
20.1.2;Overloading Indexer Methods;527
20.1.3;Indexers with Multiple Dimensions;528
20.1.4;Indexer Definitions on Interface Types;529
20.2;Understanding Operator Overloading;529
20.2.1;Overloading Binary Operators;530
20.2.2;And What of the += and –= Operators?;532
20.2.3;Overloading Unary Operators;533
20.2.4;Overloading Equality Operators;534
20.2.5;Overloading Comparison Operators;535
20.2.6;The Internal Representation of Overloaded Operators;536
20.2.7;Final Thoughts Regarding Operator Overloading;538
20.3;Understanding Custom Type Conversions;539
20.3.1;Recall: Numerical Conversions;539
20.3.2;Recall: Conversions Among Related Class Types;540
20.3.3;Creating Custom Conversion Routines;541
20.3.4;Additional Explicit Conversions for the Square Type;544
20.3.5;Defining Implicit Conversion Routines;544
20.3.6;The Internal Representation of Custom Conversion Routines;546
20.3.7;Understanding Extension Methods;547
20.3.7.1;Defining Extension Methods;547
20.3.7.2;Invoking Extension Methods on an Instance Level;549
20.3.7.3;Invoking Extension Methods as Shared Methods;550
20.3.7.4;The Scope of an Extension Method;551
20.3.7.5;Importing Types That Define Extension Methods;552
20.3.7.6;The IntelliSense of Extension Methods;553
20.3.7.7;Building and Using Extension Libraries;554
20.3.7.8;Extending Interface Types via Extension Methods;556
20.3.8;Understanding Partial Methods;558
20.3.8.1;A First Look at Partial Methods;558
20.3.8.2;Uses of Partial Methods;560
20.3.9;Understanding Anonymous Types;560
20.3.9.1;The Internal Representation of Anonymous Types;562
20.3.9.2;The Implementation of ToString() and GetHashCode();564
20.3.9.3;The Semantics of Equality for Anonymous Types;564
20.3.9.4;Anonymous Types Containing Anonymous Types;566
20.4;Summary;567
21;Chapter 13: LINQ to Objects ;568
21.1;LINQ Specific Programming Constructs;568
21.1.1;Implicit Typing of Local Variables;569
21.1.2;Object and Collection Initialization Syntax;570
21.1.3;Lambda Expressions;570
21.1.4;Extension Methods;571
21.1.5;Anonymous Types;572
21.2;Understanding the Role of LINQ;572
21.2.1;LINQ Expressions Are Strongly Typed;574
21.2.2;The Core LINQ Assemblies;574
21.3;Applying LINQ Queries to Primitive Arrays;575
21.3.1;Once Again, Without LINQ;576
21.3.2;Reflecting Over a LINQ Result Set;577
21.3.3;LINQ and Implicitly Typed Local Variables;578
21.3.4;LINQ and Extension Methods;580
21.3.5;The Role of Deferred Execution;581
21.3.6;The Role of Immediate Execution;582
21.4;Returning the Result of a LINQ Query;583
21.4.1;Returning LINQ Results via Immediate Execution;584
21.5;Applying LINQ Queries to Collection Objects;585
21.5.1;Accessing Contained Subobjects;586
21.5.2;Applying LINQ Queries to Nongeneric Collections;587
21.5.3;Filtering Data Using OfType(Of T)();588
21.6;Investigating the VB 2010 LINQ Query Operators;588
21.6.1;Basic Selection Syntax;590
21.6.2;Obtaining Subsets of Data;591
21.6.3;Projecting New Data Types;592
21.6.4;Obtaining Counts Using Enumerable;593
21.6.5;Reversing Result Sets;594
21.6.6;Sorting Expressions;594
21.6.7;LINQ As a Better Venn Diagramming Tool;595
21.6.8;Removing Duplicates;597
21.6.9;LINQ Aggregation Operations;597
21.7;The Internal Representation of LINQ Query Statements;598
21.7.1;Building Query Expressions with Query Operators (Revisited);599
21.7.2;Building Query Expressions Using the Enumerable Type and Lambda Expressions;599
21.7.3;Building Query Expressions Using the Enumerable Type and Anonymous Methods;601
21.7.4;Building Query Expressions Using the Enumerable Type and Raw Delegates;602
21.8;Summary;603
22;Chapter 14: Configuring .NET Assemblies;604
22.1;Observing the Root Namespace;604
22.2;Defining Namespaces Beyond the Root;605
22.3;Defining Custom Namespaces;606
22.4;Resolving Name Clashes with Fully Qualified Names;608
22.5;Resolving Name Clashes with Aliases;609
22.6;Creating Nested Namespaces;611
22.7;The Role of .NET Assemblies;612
22.7.1;Assemblies Promote Code Reuse;612
22.7.2;Assemblies Establish a Type Boundary;613
22.7.3;Assemblies Are Versionable Units;613
22.7.4;Assemblies Are Self-Describing;613
22.7.5;Assemblies Are Configurable;613
22.8;Understanding the Format of a .NET Assembly;614
22.8.1;The Windows File Header;614
22.8.2;The CLR File Header;616
22.8.3;CIL Code, Type Metadata, and the Assembly Manifest;617
22.8.4;Optional Assembly Resources;618
22.8.5;Single-File and Multifile Assemblies;618
22.9;Building and Consuming a Single-File Assembly;620
22.9.1;Exploring the Manifest;624
22.9.2;Exploring the CIL;627
22.9.3;Exploring the Type Metadata;628
22.9.4;Building a VB 2010 Client Application;629
22.9.5;Building a C# Client Application;631
22.9.6;Cross-Language Inheritance in Action;632
22.10;Building and Consuming a Multifile Assembly;633
22.10.1;Exploring the ufo.netmodule File;634
22.10.2;Exploring the airvehicles.dll File;634
22.10.3;Consuming a Multifile Assembly;635
22.11;Understanding Private Assemblies;636
22.11.1;The Identity of a Private Assembly;637
22.11.2;Understanding the Probing Process;637
22.11.3;Configuring Private Assemblies;638
22.11.4;Configuration Files and Visual Studio 2010;640
22.12;Understanding Shared Assemblies;643
22.12.1;Understanding Strong Names;644
22.12.2;Generating Strong Names at the Command Line;646
22.12.3;Generating Strong Names using Visual Studio 2010;648
22.12.4;Installing Strongly Named Assemblies to the GAC;649
22.13;Consuming a Shared Assembly;652
22.13.1;Exploring the Manifest of SharedCarLibClient;653
22.14;Configuring Shared Assemblies;654
22.14.1;Freezing the Current Shared Assembly;654
22.14.2;Building Shared Assembly Version 2.0.0.0;655
22.14.3;Dynamically Redirecting to Specific Versions of a Shared Assembly;659
22.15;Understanding Publisher Policy Assemblies;660
22.15.1;Disabling Publisher Policy;661
22.16;Understanding the Element;661
22.17;The System.Configuration Namespace;664
22.18;Summary;665
23;Chapter 15: Type Reflection, Late Binding, and Attribute-Based Programming;666
23.1;The Necessity of Type Metadata;666
23.1.1;Viewing (Partial) Metadata for the EngineState Enumeration;667
23.1.2;Viewing (Partial) Metadata for the Car Type;668
23.1.3;Examining a TypeRef;670
23.1.4;Documenting the Defining Assembly;670
23.1.5;Documenting Referenced Assemblies;670
23.1.6;Documenting String Literals;671
23.2;Understanding Reflection;672
23.2.1;The System.Type Class;673
23.2.2;Obtaining a Type Reference Using System.Object.GetType();674
23.2.3;Obtaining a Type Reference Using System.Type.GetType();674
23.2.4;Obtaining a Type Reference Using GetType();675
23.3;Building a Custom Metadata Viewer;675
23.3.1;Reflecting on Methods;675
23.3.2;Reflecting on Fields and Properties;676
23.3.3;Reflecting on Implemented Interfaces;677
23.3.4;Displaying Various Odds and Ends;677
23.3.5;Implementing Main();678
23.3.6;Reflecting on Generic Types;680
23.3.7;Reflecting on Method Parameters and Return Values;680
23.4;Dynamically Loading Assemblies;682
23.5;Reflecting on Shared Assemblies;686
23.6;Understanding Late Binding;687
23.6.1;The System.Activator Class;688
23.6.2;Invoking Methods with No Parameters;689
23.6.3;Invoking Methods with Parameters;690
23.7;Understanding the Role of .NET Attributes;691
23.7.1;Attribute Consumers;692
23.7.2;Applying Attributes in VB 2010;693
23.7.3;VB 2010 Attribute Shorthand Notation;695
23.7.4;Specifying Constructor Parameters for Attributes;695
23.7.5;The Obsolete Attribute in Action;695
23.8;Building Custom Attributes;696
23.8.1;Applying Custom Attributes;697
23.8.2;Named Property Syntax;697
23.8.3;Restricting Attribute Usage;698
23.9;Assembly-Level (and Module-Level) Attributes;699
23.9.1;The Visual Studio 2010 AssemblyInfo.vb File;700
23.10;Reflecting on Attributes Using Early Binding;701
23.11;Reflecting on Attributes Using Late Binding;702
23.12;Putting Reflection, Late Binding, and Custom Attributes in Perspective;704
23.13;Building an Extendable Application;705
23.13.1;Building CommonSnappableTypes.dll;706
23.13.2;Building the VB 2010 Snap-In;706
23.13.3;Building the C# Snap-In;707
23.13.4;Building an Extendable Windows Forms Application;707
23.14;Summary;712
24;Chapter 16: Processes, AppDomains, and Object Contexts;713
24.1;The Role of a Windows Process;713
24.1.1;The Role of Threads;714
24.2;Interacting with Processes Under the .NET Platform;716
24.2.1;Enumerating Running Processes;718
24.2.2;Investigating a Specific Process;720
24.2.3;Investigating a Process’s Thread Set;720
24.2.4;Investigating a Process’s Module Set;723
24.2.5;Starting and Stopping Processes Programmatically;726
24.2.6;Controlling Process Startup Using the ProcessStartInfo Class;726
24.3;Understanding .NET Application Domains;728
24.3.1;The System.AppDomain Class;728
24.4;Interacting with the Default Application Domain;731
24.4.1;Enumerating Loaded Assemblies;732
24.4.2;Receiving Assembly Load Notifications;734
24.5;Creating New Application Domains;734
24.5.1;Loading Assemblies into Custom Application Domains;737
24.5.2;Programmatically Unloading AppDomains;738
24.6;Understanding Object Context Boundaries;740
24.6.1;Context-Agile and Context-Bound Types;741
24.6.2;Defining a Context-Bound Object;741
24.6.3;Inspecting an Object’s Context;742
24.7;Summarizing Processes, AppDomains, and Context;744
24.8;Summary;745
25;Chapter 17: Understanding CIL and the Role of Dynamic Assemblies;746
25.1;Reasons for Learning the Grammar of CIL;746
25.2;Examining CIL Directives, Attributes, and Opcodes;747
25.2.1;The Role of CIL Directives;748
25.2.2;The Role of CIL Attributes;748
25.2.3;The Role of CIL Opcodes;748
25.2.4;The CIL Opcode/CIL Mnemonic Distinction;749
25.3;Pushing and Popping: The Stack-Based Nature of CIL;749
25.4;Understanding Round-Trip Engineering;751
25.4.1;The Role of CIL Code Labels;754
25.4.2;Interacting with CIL: Modifying an *.il File;755
25.4.3;Compiling CIL Code Using ilasm.exe;756
25.4.4;Authoring CIL Code Using SharpDevelop;760
25.4.5;The Role of peverify.exe;762
25.5;Understanding CIL Directives and Attributes;762
25.5.1;Specifying Externally Referenced Assemblies in CIL;762
25.5.2;Defining the Current Assembly in CIL;763
25.5.3;Defining Namespaces in CIL;764
25.5.4;Defining Class Types in CIL;764
25.5.5;Defining and Implementing Interfaces in CIL;766
25.5.6;Defining Structures in CIL;767
25.5.7;Defining Enums in CIL;767
25.5.8;Defining Generics in CIL;768
25.5.9;Compiling the CILTypes.il file;768
25.6;.NET Base Class Library, VB 2010, and CIL Data Type Mappings;770
25.7;Defining Type Members in CIL;771
25.7.1;Defining Field Data in CIL;771
25.7.2;Defining Type Constructors in CIL;772
25.7.3;Defining Properties in CIL;772
25.7.4;Defining Member Parameters;773
25.8;Examining CIL Opcodes;774
25.8.1;The .maxstack Directive;777
25.8.2;Declaring Local Variables in CIL;777
25.8.3;Mapping Parameters to Local Variables in CIL;778
25.8.4;The Hidden Me Reference;779
25.8.5;Representing Iteration Constructs in CIL;779
25.9;Building a .NET Assembly with CIL;780
25.9.1;Building CILCars.dll;780
25.9.2;Building CILCarClient.exe;783
25.10;Understanding Dynamic Assemblies;786
25.10.1;Exploring the System.Reflection.Emit Namespace;786
25.10.2;The Role of the System.Reflection.Emit.ILGenerator;787
25.10.3;Emitting a Dynamic Assembly;788
25.10.4;Emitting the Assembly and Module Set;791
25.10.5;The Role of the ModuleBuilder Type;792
25.10.6;Emitting the HelloClass Type and the String Member Variable;793
25.10.7;Emitting the Constructors;794
25.10.8;Emitting the SayHello() Method;795
25.10.9;Using the Dynamically Generated Assembly;795
25.11;Summary;797
26;Chapter 18: Dynamic Types and the Dynamic Language Runtime;798
26.1;Basics of Dynamic Typing in VB 2010;798
26.2;The Role of Dynamic Typing in VB 2010;799
26.2.1;Calling Members on Dynamically Declared Data;801
26.2.2;The Role of the Microsoft.VisualBasic.dll Assembly;802
26.2.3;The Scope of the Dynamic Objects;803
26.2.4;Limitations of the Dynamic Type;804
26.2.5;Practical Uses of the Dynamic Types;805
26.3;The Role of the Dynamic Language Runtime (DLR);805
26.3.1;The Role of Expression Trees;806
26.3.2;The Role of the System.Dynamic Namespace;806
26.3.3;Dynamic Runtime Lookup of Expression Trees;807
26.4;Simplifying Late Bound Calls Using Dynamic Typing;807
26.4.1;Leveraging the Dynamic Typing to Pass Arguments;808
26.5;Simplifying COM Interoperability using Dynamic Data;810
26.5.1;The Role of Primary Interop Assemblies (PIAs);812
26.5.2;Embedding Interop Metadata;813
26.5.3;Common COM Interop Pain Points;814
26.6;COM Interop using VB 2010 Language Features;815
26.6.1;COM Interop without VB 2010 Language Features;819
26.7;Summary;821
27;Chapter 19: Multithreaded and Parallel Programming;823
27.1;The Process/AppDomain/Context/Thread Relationship;823
27.1.1;The Problem of Concurrency;825
27.1.2;The Role of Thread Synchronization;825
27.2;A Brief Review of the .NET Delegate;825
27.3;The Asynchronous Nature of Delegates;828
27.3.1;The BeginInvoke() and EndInvoke() Methods;828
27.3.2;The System.IAsyncResult Interface;829
27.4;Invoking a Method Asynchronously;829
27.4.1;Synchronizing the Calling Thread;830
27.4.2;The Role of the AsyncCallback Delegate;832
27.4.3;The Role of the AsyncResult Class;834
27.4.4;Passing and Receiving Custom State Data;835
27.5;The System.Threading Namespace;836
27.6;The System.Threading.Thread Class;837
27.6.1;Obtaining Statistics About the Current Thread;839
27.6.2;The Name Property;840
27.6.3;The Priority Property;841
27.7;Programmatically Creating Secondary Threads;841
27.7.1;Working with the ThreadStart Delegate;842
27.7.2;Working with the ParameterizedThreadStart Delegate;844
27.7.3;The AutoResetEvent Class;845
27.7.4;Foreground Threads and Background Threads;846
27.8;The Issue of Concurrency;848
27.8.1;Synchronization Using the VB 2010 SyncLock Keyword;851
27.8.2;Synchronization Using the System.Threading.Monitor Type;854
27.8.3;Synchronization Using the System.Threading.Interlocked Type;855
27.8.4;Synchronization Using the Attribute;856
27.9;Programming with Timer Callbacks;856
27.10;Understanding the CLR ThreadPool;858
27.11;Parallel Programming under the .NET Platform;860
27.11.1;The Task Parallel Library API;860
27.11.2;The Role of the Parallel Class;862
27.11.3;Understanding Data Parallelism;862
27.11.4;The Task Class;864
27.11.5;Handling Cancelation Request;865
27.11.6;Understanding Task Parallelism;866
27.12;Parallel LINQ Queries (PLINQ);870
27.12.1;Opting in to a PLINQ Query;871
27.12.2;Canceling a PLINQ Query;872
27.13;Summary;873
28;Chapter 20: File I/O and Object Serialization;874
28.1;Exploring the System.IO Namespace;874
28.2;The Directory(Info) and File(Info) Types;876
28.2.1;The MustInherit FileSystemInfo Base Class;876
28.3;Working with the DirectoryInfo Type;877
28.3.1;Enumerating Files with the DirectoryInfo Type;879
28.3.2;Creating Subdirectories with the DirectoryInfo Type;880
28.4;Working with the Directory Type;881
28.5;Working with the DriveInfo Class Type;882
28.6;Working with the FileInfo Class;884
28.6.1;The FileInfo.Create() Method;885
28.6.2;The FileInfo.Open() Method;886
28.6.3;The FileInfo.OpenRead() and FileInfo.OpenWrite() Methods;887
28.6.4;The FileInfo.OpenText() Method;888
28.6.5;The FileInfo.CreateText() and FileInfo.AppendText() Methods;888
28.7;Working with the File Type;889
28.7.1;Additional File-centric Members;890
28.8;The MustInherit Stream Class;891
28.8.1;Working with FileStreams;892
28.9;Working with StreamWriters and StreamReaders;894
28.9.1;Writing to a Text File;895
28.9.2;Reading from a Text File;896
28.9.3;Directly Creating StreamWriter/StreamReader Types;897
28.10;Working with StringWriters and StringReaders;897
28.11;Working with BinaryWriters and BinaryReaders;899
28.12;Watching Files Programmatically;901
28.13;Understanding Object Serialization;903
28.13.1;The Role of Object Graphs;905
28.14;Configuring Objects for Serialization;906
28.14.1;Defining Serializable Types;906
28.14.2;Public Fields, Private Fields, and Public Properties;907
28.15;Choosing a Serialization Formatter;908
28.15.1;The IFormatter and IRemotingFormatter Interfaces;908
28.15.2;Type Fidelity Among the Formatters;909
28.16;Serializing Objects Using the BinaryFormatter;910
28.16.1;Deserializing Objects Using the BinaryFormatter;912
28.17;Serializing Objects Using the SoapFormatter;912
28.18;Serializing Objects Using the XmlSerializer;914
28.18.1;Controlling the Generated XML Data;915
28.19;Serializing Collections of Objects;916
28.20;Customizing the Soap/Binary Serialization Process;918
28.20.1;A Deeper Look at Object Serialization;919
28.20.2;Customizing Serialization Using ISerializable;919
28.20.3;Customizing Serialization Using Attributes;923
28.21;Summary;924
29;Chapter 21: ADO.NET Part I: The Connected Layer;925
29.1;A High-Level Definition of ADO.NET;925
29.1.1;The Three Faces of ADO.NET;927
29.2;Understanding ADO.NET Data Providers;927
29.2.1;The Microsoft-Supplied ADO.NET Data Providers;929
29.2.2;A Word Regarding System.Data.OracleClient.dll;931
29.2.3;Obtaining Third-Party ADO.NET Data Providers;931
29.3;Additional ADO.NET Namespaces;931
29.4;The Types of the System.Data Namespace;932
29.4.1;The Role of the IDbConnection Interface;934
29.4.2;The Role of the IDbTransaction Interface;934
29.4.3;The Role of the IDbCommand Interface;935
29.4.4;The Role of the IDbDataParameter and IDataParameter Interfaces;935
29.4.5;The Role of the IDbDataAdapter and IDataAdapter Interfaces;936
29.4.6;The Role of the IDataReader and IDataRecord Interfaces;936
29.5;Abstracting Data Providers Using Interfaces;937
29.5.1;Increasing Flexibility Using Application Configuration Files;939
29.6;Creating the AutoLot Database;941
29.6.1;Creating the Inventory Table;941
29.6.2;Authoring the GetPetName() Stored Procedure;944
29.6.3;Creating the Customers and Orders Tables;945
29.6.4;Visually Creating Table Relationships;947
29.7;The ADO.NET Data Provider Factory Model;948
29.7.1;A Complete Data Provider Factory Example;949
29.7.2;A Potential Drawback with the Provide Factory Model;953
29.7.3;The Element;953
29.8;Understanding the Connected Layer of ADO.NET;955
29.8.1;Working with Connection Objects;956
29.8.2;Working with ConnectionStringBuilder Objects;958
29.8.3;Working with Command Objects;959
29.9;Working with Data Readers;960
29.9.1;Obtaining Multiple Result Sets Using a Data Reader;962
29.10;Building a Reusable Data Access Library;963
29.10.1;Adding the Connection Logic;964
29.10.2;Adding the Insertion Logic;965
29.10.3;Adding the Deletion Logic;966
29.10.4;Adding the Update Logic;967
29.10.5;Adding the Selection Logic;967
29.10.6;Working with Parameterized Command Objects;968
29.10.6.1;Specifying Parameters Using the DbParameter Type;968
29.10.7;Executing a Stored Procedure;970
29.11;Creating a Console UI–Based Front End;972
29.11.1;Implementing the Main() Method;973
29.11.2;Implementing the ShowInstructions() Method;974
29.11.3;Implementing the ListInventory() Method;974
29.11.4;Implementing the DeleteCar() Method;975
29.11.5;Implementing the InsertNewCar() Method;976
29.11.6;Implementing the UpdateCarPetName() Method;977
29.11.7;Implementing LookUpPetName();977
29.12;Understanding Database Transactions;979
29.12.1;Key Members of an ADO.NET Transaction Object;980
29.12.2;Adding a CreditRisks Table to the AutoLot Database;981
29.12.3;Adding a Transaction Method to InventoryDAL;982
29.12.4;Testing Your Database Transaction;984
29.13;Summary;985
30;Chapter 22: ADO.NET Part II: The Disconnected Layer ;986
30.1;Understanding the Disconnected Layer of ADO.NET;986
30.2;Understanding the Role of the DataSet;987
30.2.1;Key Properties of the DataSet;988
30.2.2;Key Methods of the DataSet;989
30.2.3;Building a DataSet;990
30.3;Working with DataColumns;990
30.3.1;Building a DataColumn;992
30.3.2;Enabling Autoincrementing Fields;992
30.3.3;Adding DataColumn Objects to a DataTable;993
30.4;Working with DataRows;993
30.4.1;Understanding the RowState Property;995
30.4.2;Understanding the DataRowVersion Property;997
30.5;Working with DataTables;998
30.5.1;Inserting DataTables into DataSets;999
30.5.2;Obtaining Data in a DataSet;999
30.5.3;Processing DataTable Data Using DataTableReader Objects;1000
30.5.4;Serializing DataTable/DataSet Objects As XML;1002
30.5.5;Serializing DataTable/DataSet Objects in a Binary Format;1003
30.6;Binding DataTable Objects to Windows Forms GUIs;1004
30.6.1;Hydrating a DataTable from a Generic List(Of T);1006
30.6.2;Deleting Rows from a DataTable;1008
30.6.3;Selecting Rows Based on Filter Criteria;1010
30.6.4;Updating Rows Within a DataTable;1013
30.6.5;Working with the DataView Type;1013
30.7;Working with Data Adapters;1015
30.7.1;A Simple Data Adapter Example;1016
30.7.2;Mapping Database Names to Friendly Names;1018
30.8;Adding Disconnection Functionality to AutoLotDAL.dll;1019
30.8.1;Defining the Initial Class Type;1019
30.8.2;Configuring the Data Adapter Using the SqlCommandBuilder;1020
30.8.3;Implementing GetAllInventory();1021
30.8.4;Implementing UpdateInventory();1021
30.8.5;Setting Your Version Number;1022
30.8.6;Testing the Disconnected Functionality;1022
30.9;Multitabled DataSet Objects and Data Relationships;1023
30.9.1;Prepping the Data Adapters;1024
30.9.2;Building the Table Relationships;1026
30.9.3;Updating the Database Tables;1026
30.9.4;Navigating Between Related Tables;1027
30.10;The Windows Forms Database Designer Tools;1030
30.10.1;Visually Designing the DataGridView;1030
30.10.2;The Generated app.config File;1035
30.10.3;Examining the Strongly Typed DataSet;1035
30.10.4;Examining the Strongly Typed DataTable;1037
30.10.5;Examining the Strongly Typed DataRow;1038
30.10.6;Examining the Strongly Typed Data Adapter;1039
30.10.7;Completing the Windows Forms Application;1040
30.11;Isolating Strongly Typed Database Code into a Class Library;1041
30.11.1;Viewing the Generated Code;1043
30.11.2;Selecting Data with the Generated Code;1044
30.11.3;Inserting Data with the Generated Code;1045
30.11.4;Deleting Data with the Generated Code;1046
30.11.5;Invoking a Stored Procedure using the Generated Code;1047
30.12;Programming with LINQ to DataSet;1047
30.12.1;The Role of the DataSet Extensions Library;1049
30.12.2;Obtaining a LINQ-Compatible DataTable;1049
30.12.3;The Role of the DataRowExtensions.Field(Of T)() Extension Method;1051
30.12.4;Hydrating New DataTables from LINQ Queries;1051
30.13;Summary;1052
31;Chapter 23: ADO.NET Part III: The Entity Framework;1053
31.1;Understanding the Role of Entity Framework;1053
31.1.1;The Role of Entities;1055
31.1.2;The Building Blocks of the Entity Framework;1057
31.1.2.1;The Role of Object Services;1058
31.1.2.2;The Role of the Entity Client;1059
31.1.2.3;The Role of the *.edmx File (and Friends);1060
31.1.2.4;The Role of the ObjectContext and ObjectSet(Of T) Classes;1060
31.1.2.5;All Together Now!;1062
31.2;Building and Analyzing your First EDM;1064
31.2.1;Generating the *.edmx File;1064
31.2.2;Reshaping the Entity Data;1068
31.2.3;Viewing the Mappings;1070
31.2.4;Viewing the Generated *.edmx File Data;1071
31.2.5;Viewing the Generated Source Code;1073
31.2.6;Enhancing the Generated Source Code;1075
31.3;Programming Against the Conceptual Model;1076
31.3.1;Deleting a Record;1077
31.3.2;Updating a Record;1078
31.3.3;Querying with LINQ to Entities;1078
31.3.4;Querying with Entity SQL;1080
31.3.5;Working with the Entity Client Data Reader Object;1081
31.4;AutoLotDAL Version 4.0, Now with Entities;1082
31.4.1;Mapping the Stored Procedure;1083
31.4.2;The Role of Navigation Properties;1085
31.4.3;Using Navigation Properties within LINQ to Entity Queries;1087
31.4.4;Invoking a Stored Procedure;1088
31.5;Data Binding Entities to Windows Forms GUIs;1089
31.5.1;Adding the Data Binding Code;1092
31.6;Summary;1094
32;Chapter 24: Introducing LINQ to XML;1095
32.1;A Tale of Two XML APIs;1095
32.1.1;LINQ to XML As a Better DOM;1097
32.1.2;VB 2010 Literal Syntax As a Better LINQ to XML;1098
32.2;Members of the System.Xml.Linq Namespace;1099
32.2.1;The LINQ to XML Axis Methods;1102
32.2.2;The Oddness of XName (and XNamespace);1103
32.3;Working with XElement and XDocument;1104
32.3.1;Generating Documents from Arrays and Containers;1107
32.3.2;Loading and Parsing XML Content;1108
32.4;Manipulating an in Memory XML Document;1109
32.4.1;Building the UI of the LINQ to XML App;1109
32.4.2;Import the Inventory.xml File;1110
32.4.3;Defining a LINQ to XML Helper Class;1111
32.4.4;Rigging up the UI to Your Helper Class;1112
32.5;Summary;1113
33;Chapter 25: Introducing Windows Communication Foundation;1114
33.1;A Potpourri of Distributed Computing APIs;1114
33.1.1;The Role of DCOM;1115
33.1.2;The Role of COM+/Enterprise Services;1116
33.1.3;The Role of MSMQ;1116
33.1.4;The Role of .NET Remoting;1117
33.1.5;The Role of XML Web Services;1117
33.1.5.1;A .NET Web Service Example;1118
33.1.5.2;Web Service Standards;1120
33.1.6;Named Pipes, Sockets, and P2P;1120
33.2;The Role of WCF;1120
33.2.1;An Overview of WCF Features;1121
33.2.2;An Overview of Service-Oriented Architecture;1121
33.2.2.1;Tenet 1: Boundaries Are Explicit;1122
33.2.2.2;Tenet 2: Services Are Autonomous;1122
33.2.2.3;Tenet 3: Services Communicate via Contract, Not Implementation;1122
33.2.2.4;Tenet 4: Service Compatibility Is Based on Policy;1122
33.2.3;WCF: The Bottom Line;1123
33.3;Investigating the Core WCF Assemblies;1123
33.4;The Visual Studio WCF Project Templates;1124
33.4.1;The WCF Service Website Project Template;1126
33.5;The Basic Composition of a WCF Application;1126
33.6;The ABCs of WCF;1128
33.6.1;Understanding WCF Contracts;1128
33.6.2;Understanding WCF Bindings;1129
33.6.2.1;HTTP-Based Bindings;1130
33.6.2.2;TCP-Based Bindings;1131
33.6.2.3;MSMQ-Based Bindings;1131
33.6.3;Understanding WCF Addresses;1132
33.7;Building a WCF Service;1133
33.7.1;The Attribute;1134
33.7.2;The Attribute;1135
33.7.3;Service Types As Operational Contracts;1136
33.8;Hosting the WCF Service;1137
33.8.1;Establishing the ABCs Within an App.config File;1137
33.8.2;Coding Against the ServiceHost Type;1138
33.8.3;Specifying Base Addresses;1139
33.8.4;Details of the ServiceHost Type;1140
33.8.5;Details of the Element;1142
33.8.6;Enabling Metadata Exchange;1143
33.9;Building the WCF Client Application;1147
33.9.1;Generating Proxy Code Using svcutil.exe;1147
33.9.2;Generating Proxy Code Using Visual Studio 2010;1148
33.9.3;Configuring a TCP-Based Binding;1150
33.10;Simplifying Configuration Settings with WCF 4.0;1152
33.10.1;Default Endpoints in WCF 4.0;1152
33.10.2;Exposing a Single WCF Service Using Multiple Bindings;1154
33.10.3;Changing Settings for a WCF Binding;1155
33.10.4;The WCF 4.0 Default MEX Behavior Configuration;1157
33.10.5;Refreshing the Client Proxy and Selecting the Binding;1158
33.11;Using the WCF Service Library Project Template;1160
33.11.1;Building a Simple Math Service;1160
33.11.2;Testing the WCF Service with WcfTestClient.exe;1161
33.11.3;Altering Configuration Files Using SvcConfigEditor.exe;1162
33.12;Hosting the WCF Service within a Windows Service;1163
33.12.1;Specifying the ABCs in Code;1165
33.12.2;Enabling MEX;1166
33.12.3;Creating a Windows Service Installer;1167
33.12.4;Installing the Windows Service;1169
33.13;Invoking a Service Asynchronously from the Client;1170
33.14;Designing WCF Data Contracts;1172
33.14.1;Using the Web-Centric WCF Service Project Template;1173
33.14.2;Implementing the Service Contract;1175
33.14.3;The Role of the *.svc File;1176
33.14.4;Examining the Web.config File;1176
33.14.5;Testing the Service;1177
33.15;Summary;1178
34;Chapter 26: Introducing Windows Workflow Foundation 4.0;1179
34.1;Defining a Business Process;1180
34.1.1;The Role of WF 4.0;1180
34.2;Building a (Painfully) Simple Workflow;1181
34.2.1;Viewing the Underlying XAML;1183
34.3;The WF 4.0 Runtime;1185
34.3.1;Hosting a Workflow using WorkflowInvoker;1185
34.3.1.1;Passing Arguments to your Workflow using WorkflowInvoker;1186
34.3.1.2;Defining Arguments Using the Workflow Designer;1186
34.3.2;Hosting a Workflow using WorkflowApplication;1188
34.3.3;Recap of your First Workflow;1190
34.4;Examining the Workflow 4.0 Activities;1190
34.4.1;Control Flow Activities;1190
34.4.2;Flowchart Activities;1191
34.4.3;Messaging Activities;1192
34.4.4;The Runtime and Primitives Activities;1193
34.4.5;The Transaction Activities;1193
34.4.6;The Collection and Error Handling Activities;1194
34.5;Building a Flowchart Workflow;1194
34.5.1;Connecting Activities in a Flowchart;1195
34.5.2;Working with the InvokeMethod Activity;1196
34.5.3;Defining Workflow Wide Variables;1197
34.5.4;Working with the FlowDecision Activity;1197
34.5.5;Working with the TerminateWorkflow Activity;1198
34.5.6;Building the “True” Condition;1199
34.5.7;Working with the ForEach Activity;1200
34.5.8;Completing the Application;1202
34.5.9;Reflecting on What We Have Done;1203
34.6;Isolating Workflows into Dedicated Libraries;1205
34.6.1;Defining the Initial Project;1205
34.6.2;Importing Assemblies and Namespaces;1207
34.6.3;Defining the Workflow Arguments;1207
34.6.4;Defining Workflow Variables;1208
34.6.5;Working with the Assign Activity;1209
34.6.6;Working with the If and Switch Activities;1209
34.6.7;Building a Custom Code Activity;1211
34.7;Consuming the Workflow Library;1214
34.7.1;Retrieving the Workflow Output Argument;1214
34.8;Summary;1216
35;Chapter 27: Introducing Windows Presentation Foundation and XAML;1217
35.1;The Motivation Behind WPF;1217
35.1.1;Unifying Diverse APIs;1218
35.1.2;Providing a Separation of Concerns via XAML;1219
35.1.3;Providing an Optimized Rendering Model;1220
35.1.4;Simplifying Complex UI Programming;1220
35.2;The Various Flavors of WPF;1221
35.2.1;Traditional Desktop Applications;1221
35.2.2;Navigation-Based WPF Applications;1224
35.2.3;XBAP Applications;1224
35.2.4;The WPF/Silverlight Relationship;1226
35.3;Investigating the WPF Assemblies;1226
35.3.1;The Role of the Application Class;1228
35.3.1.1;Constructing an Application Class;1229
35.3.1.2;Enumerating the Application.Windows collection;1230
35.3.2;The Role of the Window Class;1230
35.3.2.1;The Role of System.Windows.Controls.ContentControl;1231
35.3.2.2;The Role of System.Windows.Controls.Control;1233
35.3.2.3;The Role of System.Windows.FrameworkElement;1233
35.3.2.4;The Role of System.Windows.UIElement;1234
35.3.2.5;The Role of System.Windows.Media.Visual;1235
35.3.2.6;The Role of System.Windows.DependencyObject;1235
35.3.2.7;The Role of System.Windows.Threading.DispatcherObject;1235
35.4;Building a WPF Application without XAML;1236
35.4.1;Creating a Strongly Typed Window;1238
35.4.2;Creating a Simple User Interface;1238
35.4.3;Interacting with Application Level Data;1240
35.4.4;Handling the Closing of a Window Object;1241
35.4.5;Intercepting Mouse Events;1242
35.4.6;Intercepting Keyboard Events;1243
35.5;Building a WPF Application using Only XAML;1245
35.5.1;Defining MainWindow in XAML;1246
35.5.2;Defining the Application Object in XAML;1247
35.5.3;Processing the XAML Files using msbuild.exe;1248
35.6;Transforming Markup into a .NET Assembly;1250
35.6.1;Mapping the Window XAML Data to VB 2010 Code;1250
35.6.2;The Role of BAML;1252
35.6.3;Mapping the Application XAML Data to VB 2010 Code;1253
35.6.4;XAML-to-Assembly Process Summary;1254
35.7;Understanding The Syntax of WPF XAML;1255
35.7.1;Introducing Kaxaml;1255
35.7.2;XAML XML Namespaces and XAML "Keywords";1256
35.7.3;Controlling Class and Member Variable Declarations;1259
35.7.4;XAML Elements, XAML Attributes and Type Converters;1260
35.7.5;Understanding XAML Property-Element Syntax;1261
35.7.6;Understanding XAML Attached Properties;1262
35.7.7;Understanding XAML Markup Extensions;1263
35.8;Building a WPF Application using Code-Behind Files;1265
35.8.1;Adding a Code File for the MainWindow Class;1265
35.8.2;Adding a Code File for the MyApp Class;1266
35.8.3;Processing the Code Files with msbuild.exe;1267
35.9;Building WPF Applications Using Visual Studio 2010;1268
35.9.1;The WPF Project Templates;1268
35.9.2;Exploring the WPF Designer Tools;1269
35.9.3;Designing the GUI of our Window;1273
35.9.4;Implementing the Loaded Event;1274
35.9.5;Implementing the Button’s Click Event;1275
35.9.6;Implementing the Closed Event;1276
35.9.7;Testing the Application;1277
35.10;Summary;1278
36;Chapter 28: Programming with WPF Controls;1279
36.1;A Survey of the Core WPF Controls;1279
36.1.1;Working with WPF Controls Using Visual Studio 2010;1281
36.1.2;The WPF Ink Controls;1283
36.1.3;The WPF Document Controls;1284
36.1.4;WPF Common Dialog Boxes;1284
36.1.5;The Details Are in the Documentation;1284
36.2;Controlling Content Layout Using Panels;1285
36.2.1;Positioning Content Within Canvas Panels;1287
36.2.2;Positioning Content Within WrapPanel Panels;1289
36.2.3;Positioning Content Within StackPanel Panels;1291
36.2.4;Positioning Content Within Grid Panels;1292
36.2.4.1;Grids with GridSplitter Types;1293
36.2.5;Positioning Content Within DockPanel Panels;1294
36.2.6;Enabling Scrolling for Panel Types;1295
36.3;Building a Window’s Frame Using Nested Panels;1296
36.3.1;Building the Menu System;1297
36.3.2;Building the ToolBar;1299
36.3.3;Building the StatusBar;1299
36.3.4;Finalizing the UI Design;1299
36.3.5;Implementing the MouseEnter/MouseLeave Event Handlers;1300
36.3.6;Implementing the Spell Checking Logic;1301
36.4;Understanding WPF Control Commands;1302
36.4.1;The Intrinsic Control Command Objects;1302
36.4.2;Connecting Commands to Arbitrary Actions;1303
36.4.3;Working with the Open and Save Commands;1304
36.5;Building a WPF User Interface with Expression Blend;1308
36.5.1;Getting to know the Key Aspects of the Blend IDE;1308
36.5.2;Using the TabControl;1314
36.6;Building the Ink API Tab;1317
36.6.1;Designing the ToolBar;1318
36.6.2;The RadioButton Control;1321
36.6.3;The InkCanvas Control;1323
36.6.4;The ComboBox Control;1326
36.6.5;Saving, Loading, and Clearing InkCanvas Data;1328
36.7;Introducing the Documents API;1328
36.7.1;Block Elements and Inline Elements;1329
36.7.2;Document Layout Managers;1329
36.8;Building the Documents Tab;1330
36.8.1;Populating a FlowDocument using Blend;1331
36.8.2;Populating a FlowDocument Using Code;1333
36.8.3;Enabling Annotations and Sticky Notes;1334
36.8.4;Saving and Loading a Flow Document;1336
36.9;Introducing the WPF Data-Binding Model;1337
36.9.1;Building the Data Binding Tab;1338
36.9.2;Establishing Data Bindings using Blend;1338
36.9.3;The DataContext Property;1341
36.9.4;Data Conversion Using IValueConverter;1342
36.9.5;Establishing Data Bindings in Code;1343
36.9.6;Building the DataGrid Tab;1344
36.10;Summary;1346
37;Chapter 29: WPF Graphics Rendering Services;1347
37.1;Understanding WPF’s Graphical Rendering Services;1347
37.1.1;WPF Graphical Rendering Options;1348
37.2;Rendering Graphical Data Using Shapes;1349
37.2.1;Adding Rectangles, Ellipses, and Lines to a Canvas;1351
37.2.2;Removing Rectangles, Ellipses, and Lines from a Canvas;1354
37.2.3;Working with Polylines and Polygons;1356
37.2.4;Working with Paths;1356
37.2.4.1;The Path “Modeling Mini Language”;1358
37.3;WPF Brushes and Pens;1360
37.3.1;Configuring Brushes Using Visual Studio 2010;1361
37.3.2;Configuring Brushes in Code;1362
37.3.3;Configuring Pens;1364
37.4;Applying Graphical Transformations;1364
37.4.1;A First Look at Transformations;1365
37.4.2;Transforming our Canvas Data;1366
37.5;Working with Shapes using Expression Blend;1368
37.5.1;Selecting a Shape to Render from the Tool Palette;1368
37.5.2;Converting Shapes to Paths;1370
37.5.3;Combining Shapes;1370
37.5.4;The Brush and Transformation Editors;1371
37.6;Rendering Graphical Data Using Drawings and Geometries;1373
37.6.1;Building a DrawingBrush using Geometries;1374
37.6.2;Painting with the DrawingBrush;1375
37.6.3;Containing Drawing Types in a DrawingImage;1376
37.7;Generating Complex Vector Graphics using Expression Design;1377
37.7.1;Exporting a Design Document to XAML;1378
37.8;Rendering Graphical Data Using the Visual Layer;1379
37.8.1;The Visual Base Class and Derived Child Classes;1379
37.8.2;A First Look at using the DrawingVisual Class;1380
37.8.3;Rendering Visual Data to a Custom Layout Manager;1382
37.8.4;Responding to Hit Test Operations;1385
37.9;Summary;1386
38;Chapter 30: WPF Resources, Animations, and Styles;1387
38.1;Understanding the WPF Resource System;1387
38.1.1;Working with Binary Resources;1388
38.1.1.1;Including Loose Resource Files in a Project;1389
38.1.1.2;Configuring the Loose Resources;1389
38.1.1.3;Programmatically Loading an Image;1391
38.1.1.4;Embedding Application Resources;1392
38.2;Working with Object (Logical) Resources;1394
38.2.1;The Role of the Resources Property;1395
38.2.2;Defining Window-Wide Resources;1395
38.2.3;The {StaticResource} Markup Extension;1397
38.2.4;Changing a Resource after Extraction;1398
38.2.5;The {DynamicResource} Markup Extension;1398
38.2.6;Application-Level Resources;1399
38.2.7;Defining Merged Resource Dictionaries;1401
38.2.8;Defining a Resource-Only Assembly;1402
38.2.9;Extracting Resources in Expression Blend;1404
38.3;Understanding WPF’s Animation Services;1406
38.3.1;The Role of the Animation Class Types;1407
38.3.2;The To, From, and By Properties;1408
38.3.3;The Role of the Timeline Base Class;1408
38.3.4;Authoring an Animation in VB 2010 Code;1409
38.3.5;Controlling the Pacing of an Animation;1410
38.3.6;Reversing and Looping an Animation;1411
38.4;Authoring Animations in XAML;1412
38.4.1;The Role of Storyboards;1413
38.4.2;The Role of Event Triggers;1414
38.4.3;Animation Using Discrete Key Frames;1414
38.5;Understanding the Role of WPF Styles;1415
38.5.1;Defining and Applying a Style;1416
38.5.2;Overriding Style Settings;1417
38.5.3;Automatically Applying a Style with TargetType;1417
38.5.4;Subclassing Existing Styles;1418
38.5.5;The Role of Unnamed Styles;1419
38.5.6;Defining Styles with Triggers;1420
38.5.7;Defining Styles with Multiple Triggers;1421
38.5.8;Animated Styles;1421
38.5.9;Assigning Styles Programmatically;1422
38.6;Generating Styles with Expression Blend;1423
38.6.1;Working with Default Visual Styles;1424
38.7;Summary;1427
39;Chapter 31: WPF Control Templates and UserControls;1428
39.1;Understanding the Role of Dependency Properties;1428
39.1.1;Examining an Existing Dependency Property;1430
39.1.2;Important Notes Regarding CLR Property Wrappers;1433
39.2;Building a Custom Dependency Property;1434
39.2.1;Adding a Data Validation Routine;1437
39.2.2;Responding to the Property Change;1437
39.3;Understanding Routed Events;1439
39.3.1;The Role of Routed Bubbling Events;1440
39.3.2;Continuing or Halting Bubbling;1440
39.3.3;The Role of Routed Tunneling Events;1441
39.4;Logical Trees, Visual Trees and Default Templates;1443
39.4.1;Programmatically Inspecting a Logical Tree;1443
39.4.2;Programmatically Inspecting a Visual Tree;1445
39.4.3;Programmatically Inspecting a Control’s Default Template;1446
39.5;Building a Custom Control Template with Visual Studio 2010;1450
39.5.1;Templates as Resources;1451
39.5.2;Incorporating Visual Cues using Triggers;1452
39.5.3;The Role of {TemplateBinding} Markup Extension;1453
39.5.4;The Role of ContentPresenter;1455
39.5.5;Incorporating Templates into Styles;1456
39.6;Building Custom UserControls with Blend;1457
39.6.1;Creating a UserControl Library Project;1458
39.6.1.1;Renaming the Initial UserControl;1458
39.6.1.2;Designing the SpinControl;1459
39.6.1.3;Adding the Initial VB 2010 Code;1460
39.6.1.4;Defining an Animation using Blend;1461
39.6.1.5;Programmatically Starting our Storyboard;1464
39.7;Creating the Jackpot Deluxe WPF Application;1466
39.7.1;Extracting a UserControl from a Drawing Geometry;1466
39.7.2;The Role of .NET 4.0 Visual States;1468
39.7.2.1;Defining Visual States for the StarButton Control;1469
39.7.2.2;Defining State Transition Timings;1470
39.7.2.3;Viewing the Generated XAML;1471
39.7.2.4;Changing Visual States in Code using the VisualStateManager Class;1472
39.7.3;Finalizing the Jackpot Deluxe Application;1472
39.8;Summary;1477
40;Chapter 32: Building ASP.NET Web Pages;1478
40.1;The Role of HTTP;1478
40.1.1;The HTTP Request/Response Cycle;1479
40.1.2;HTTP Is a Stateless Protocol;1479
40.2;Understanding Web Applications and Web Servers;1480
40.2.1;The Role of IIS Virtual Directories;1480
40.2.2;The ASP.NET Development Web Server;1481
40.3;The Role of HTML;1481
40.3.1;HTML Document Structure;1482
40.3.2;The Role of an HTML Form;1483
40.3.3;The Visual Studio 2010 HTML Designer Tools;1484
40.3.4;Building an HTML Form;1486
40.4;The Role of Client-Side Scripting;1487
40.4.1;A Client-Side Scripting Example;1489
40.5;Posting Back to the Web Server;1490
40.5.1;Postbacks under ASP.NET;1490
40.6;The Feature Set of the ASP.NET API;1491
40.6.1;Major Features of ASP.NET 1.0-1.1;1491
40.6.2;Major Features of ASP.NET 2.0;1492
40.6.3;Major Features of ASP.NET 3.5 (and .NET 3.5 SP1);1493
40.6.4;Major Features of ASP.NET 4.0;1494
40.7;Building a Single File ASP.NET Web Page;1494
40.7.1;Referencing AutoLotDAL.dll;1496
40.7.2;Designing the UI;1496
40.7.3;Adding the Data Access Logic;1497
40.7.4;The Role of ASP.NET Directives;1501
40.7.5;Analyzing the “Script” Block;1502
40.7.6;Analyzing the ASP.NET Control Declarations;1503
40.7.7;Compilation Cycle for Single-File Pages;1504
40.8;Building an ASP.NET Web Page using Code Files;1505
40.8.1;Referencing the AutoLotDAL.dll Assembly;1508
40.8.2;Updating the Code File;1508
40.8.3;Compilation Cycle for Multifile Pages;1509
40.8.4;Debugging and Tracing ASP.NET Pages;1509
40.9;ASP.NET Web Sites and ASP.NET Web Applications;1511
40.10;The ASP.NET Web Site Directory Structure;1512
40.10.1;Referencing Assemblies;1513
40.10.2;The Role of the App_Code Folder;1514
40.11;The Inheritance Chain of the Page Type;1515
40.12;Interacting with the Incoming HTTP Request;1516
40.12.1;Obtaining Brower Statistics;1518
40.12.2;Access to Incoming Form Data;1518
40.12.3;The IsPostBack Property;1519
40.13;Interacting with the Outgoing HTTP Response;1519
40.13.1;Emitting HTML Content;1521
40.13.2;Redirecting Users;1521
40.14;The Life Cycle of an ASP.NET Web Page;1522
40.14.1;The Error Event;1523
40.15;The Role of the Web.config File;1525
40.15.1;The ASP.NET Website Administration Utility;1526
40.16;Summary;1527
41;Chapter 33: ASP.NET Web Controls, Master Pages, and Themes;1528
41.1;Understanding the Nature of Web Controls;1528
41.1.1;Understanding Server-Side Event Handling;1529
41.1.2;The AutoPostBack Property;1530
41.2;The Control and WebControl Base Classes;1531
41.2.1;Enumerating Contained Controls;1531
41.2.2;Dynamically Adding and Removing Controls;1535
41.2.3;Interacting with Dynamically Created Controls;1535
41.2.4;Functionality of the WebControl Base Class;1536
41.3;Major Categories of ASP.NET Web Controls;1537
41.3.1;A Brief Word Regarding System.Web.UI.HtmlControls;1539
41.3.2;Web Control Documentation;1540
41.4;Building the ASP.NET Cars Web Site;1540
41.4.1;Working with ASP.NET Master Pages;1541
41.4.1.1;Working with the TreeView Control Site Navigation Logic;1544
41.4.1.2;Establishing Bread Crumbs with the SiteMapPath Type;1547
41.4.1.3;Working with the AdRotator;1547
41.4.2;Defining the Default Content Page;1548
41.4.3;Designing the Inventory Content Page;1550
41.4.3.1;Enabling Sorting and Paging;1553
41.4.3.2;Enabling In-Place Editing;1554
41.4.4;Designing the Build-a-Car Content Page;1555
41.5;The Role of the Validation Controls;1557
41.5.1;The RequiredFieldValidator;1560
41.5.2;The RegularExpressionValidator;1560
41.5.3;The RangeValidator;1561
41.5.4;The CompareValidator;1561
41.5.5;Creating Validation Summaries;1562
41.5.6;Defining Validation Groups;1563
41.6;Working with Themes;1565
41.6.1;Understanding *.skin Files;1566
41.6.2;Applying Sitewide Themes;1568
41.6.3;Applying Themes at the Page Level;1569
41.6.4;The SkinID Property;1569
41.6.5;Assigning Themes Programmatically;1570
41.7;Summary;1572
42;Chapter 34: ASP.NET State Management Techniques;1573
42.1;The Issue of State;1573
42.2;ASP.NET State Management Techniques;1576
42.3;Understanding the Role of ASP.NET View State;1576
42.3.1;Demonstrating View State;1577
42.3.2;Adding Custom View State Data;1578
42.4;The Role of the Global.asax File;1579
42.4.1;The Global Last-Chance Exception Event Handler;1581
42.4.2;The HttpApplication Base Class;1582
42.5;Understanding the Application/Session Distinction;1583
42.5.1;Maintaining Application-Level State Data;1584
42.5.2;Modifying Application Data;1586
42.5.3;Handling Web Application Shutdown;1588
42.6;Working with the Application Cache;1588
42.6.1;Fun with Data Caching;1589
42.6.2;Modifying the *.aspx File;1591
42.7;Maintaining Session Data;1593
42.7.1;Additional Members of HttpSessionState;1596
42.8;Understanding Cookies;1597
42.8.1;Creating Cookies;1597
42.8.2;Reading Incoming Cookie Data;1599
42.9;The Role of the Element;1599
42.9.1;Storing Session Data in the ASP.NET Session State Server;1599
42.9.2;Storing Session Data in a Dedicated Database;1601
42.10;Understanding the ASP.NET Profile API;1601
42.10.1;The ASPNETDB.mdf Database;1602
42.10.2;Defining a User Profile Within Web.config;1603
42.10.3;Accessing Profile Data Programmatically;1604
42.10.4;Grouping Profile Data and Persisting Custom Objects;1607
42.11;Summary;1609
43;Appendix A: Programming with Windows Forms;1610
43.1;The Windows Forms Namespaces;1611
43.2;Building a Simple Windows Forms Application;1612
43.2.1;Populating the Controls Collection;1614
43.2.2;The Role of System.EventArgs and System.EventHandler;1617
43.3;The Visual Studio Windows Forms Project Template;1618
43.3.1;The Visual Designer Surface;1618
43.3.2;Dissecting the Initial Form;1620
43.3.3;Visually Building a Menu System;1621
43.3.4;The System.EventHandler Delegate;1624
43.4;The Anatomy of a Form;1625
43.4.1;The Functionality of the Control Class;1626
43.4.2;The Functionality of the Form Class;1629
43.4.3;The Life Cycle of a Form Type;1631
43.5;Responding to Mouse and Keyboard Activity;1634
43.5.1;Determining Which Mouse Button Was Clicked;1635
43.5.2;Determining Which Key Was Pressed;1636
43.6;Designing Dialog Boxes;1638
43.6.1;The DialogResult Property;1639
43.6.2;Configuring the Tab Order;1640
43.6.3;The Tab Order Wizard;1641
43.6.4;Setting the Form’s Default Input Button;1641
43.6.5;Displaying Dialog Boxes;1642
43.6.6;Understanding Form Inheritance;1643
43.7;Rendering Graphical Data Using GDI+;1645
43.7.1;The System.Drawing Namespace;1647
43.7.2;The Role of the Graphics Type;1648
43.7.3;Obtaining a Graphics Object with the Paint Event;1649
43.7.4;Invalidating the Form’s Client Area;1651
43.8;Building a Complete Windows Forms Application;1652
43.8.1;Building the Main Menu System;1652
43.8.2;Defining the ShapeData Type;1654
43.8.3;Defining the ShapePickerDialog Type;1655
43.8.4;Adding Infrastructure to the MainWindow Type;1656
43.8.5;Implementing the Tools Menu Functionality;1657
43.8.6;Capturing and Rendering the Graphical Output;1658
43.8.7;Implementing the Serialization Logic;1660
43.9;Summary;1661
44;Appendix B: Platform-Independent .NET Development with Mono;1662
44.1;The Platform-Independent Nature of .NET;1662
44.1.1;The Role of the CLI;1663
44.1.2;The Mainstream CLI Distributions;1664
44.1.3;The Scope of Mono;1665
44.2;Obtaining and Installing Mono;1666
44.2.1;Examining Mono’s Directory Structure;1668
44.3;The Mono Development Languages;1670
44.3.1;Working with the VB 2010 Compiler;1670
44.3.2;Building Mono Applications using MonoDevelop;1671
44.4;Microsoft-Compatible Mono Development Tools;1671
44.4.1;Mono-Specific Development Tools;1672
44.4.1.1;Using monop;1673
44.5;Building .NET Applications with Mono;1674
44.5.1;Building a Mono Code Library;1674
44.5.1.1;Assigning CoreLibDumper.dll a Strong Name;1675
44.5.1.2;Viewing the Updated Manifest with monodis;1675
44.5.1.3;Installing Assemblies into the Mono GAC;1676
44.5.2;Building a Console Application in Mono;1677
44.5.2.1;Loading Your Client Application in the Mono Runtime;1678
44.5.2.2;Executing Your Windows Forms Application Under Linux;1679
44.6;Who is Using Mono?;1680
44.7;Suggestions for Further Study;1680
44.8;Summary;1682
45;Index;1683



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.