More Ebooks:

Applied Quantitative Finance

Applied Java Patterns

Applied C++ Techniques for Building Better Software

Apache.Cookbook.eBook-LiB

Apache.Cookbook.2003

Apache The Definitive Guide v3.0

Apache Server 2 Bible

Apache Desktop Reference

Apache Definitive Guide, 2nd Edition

ANSIISO C++ Professional Programmer`s Handbook

find on eBook ToC:

Applied Microsoft® .NET Framework Programming (Pro-Developer)

Applied Microsoft® .NET Framework Programming (Pro-Developer)

Jeffrey Richter, Microsoft Press

ISBN:0735614229, Edition: , 2002-01-23

Price: $49.99

Table of Contents

Applied Microsoft .NET Framework Programming ~ 1
Introduction ~ 4
What Makes Up the Microsoft .NET Initiative ~ 7
An Underlying Operating System: Windows ~ 7
Helpful Products: The .NET Enterprise Servers ~ 7
Microsoft XML Web Services: .NET My Services ~ 8
The Development Platform: The .NET Framework ~ 8
The Development Environment: Visual Studio .NET ~ 11
Goal of This Book ~ 12
System Requirements ~ 13
This Book Has No Mistakes ~ 13
Support ~ 13

Part I: Basics of the Microsoft .NET Framework ~ 15
Chapter List ~ 15

Chapter 1: The Architecture of the .NET Framework Development Platform ~ 16

Compiling Source Code into Managed Modules ~ 16
Combining Managed Modules into Assemblies ~ 18
Loading the Common Language Runtime ~ 19
Executing Your Assembly’s Code ~ 22
IL and Verification ~ 27
The .NET Framework Class Library ~ 29
The Common Type System ~ 31
The Common Language Specification ~ 33
Interoperability with Unmanaged Code ~ 37

Chapter 2: Building, Packaging, Deploying, and Administering Applications and Types ~ 40

Overview ~ 40
.NET Framework Deployment Goals ~ 40
Building Types into a Module ~ 41
Combining Modules to Form an Assembly ~ 47
Adding Assemblies to a Project Using the Visual Studio .NET IDE ~ 52
Using the Assembly Linker ~ 53
Including Resource Files in the Assembly ~ 55
Assembly Version Resource Information ~ 55
Version Numbers ~ 59
Culture ~ 60
Simple Application Deployment (Privately Deployed Assemblies) ~ 61
Simple Administrative Control (Configuration) ~ 62

Chapter 3: Shared Assemblies ~ 66

Overview ~ 66
Two Kinds of Assemblies, Two Kinds of Deployment ~ 67
Giving an Assembly a Strong Name ~ 67
The Global Assembly Cache ~ 71
The Internal Structure of the GAC ~ 76
Building an Assembly That References a Strongly Named Assembly ~ 78
Strongly Named Assemblies Are Tamper-Resistant ~ 80
Delayed Signing ~ 81
Privately Deploying Strongly Named Assemblies ~ 84
Side-by-Side Execution ~ 85
How the Runtime Resolves Type References ~ 86
Advanced Administrative Control (Configuration) ~ 88
Publisher Policy Control ~ 93
Repairing a Faulty Application ~ 95

Part II: Working with Types and the Common Language Runtime ~ 99
Chapter List ~ 99

Chapter 4: Type Fundamentals ~ 100

All Types Are Derived from System.Object ~ 100
Casting Between Types ~ 101
Casting with the C# is and as Operators ~ 103
Namespaces and Assemblies ~ 105

Chapter 5: Primitive, Reference, and Value Types ~ 109

Programming Language Primitive Types ~ 109
Checked and Unchecked Primitive Type Operations ~ 112
Reference Types and Values Types ~ 114
Boxing and Unboxing Value Types ~ 118

Chapter 6: Common Object Operations ~ 128

Object Equality and Identity ~ 128
Implementing Equals for a Reference Type Whose Base Classes Don’t Override Object’s Equals ~ 129
Implementing Equals for a Reference Type When One or More of Its Base Classes Overrides Object’s Equals ~ 130
Implementing Equals for a Value Type ~ 131
Summary of Implementing Equals and the ==/!= Operators ~ 133
Identity ~ 134
Object Hash Codes ~ 134
Object Cloning ~ 136

Part III: Designing Types ~ 139
Chapter List ~ 139

Chapter 7: Type Members and Their Accessibility ~ 140

Type Members ~ 140
Accessibility Modifiers and Predefined Attributes ~ 142
Type Predefined Attributes ~ 144
Field Predefined Attributes ~ 144
Method Predefined Attributes ~ 145

Chapter 8: Constants and Fields ~ 147

Constants ~ 147
Fields ~ 148

Chapter 9: Methods ~ 150

Instance Constructors ~ 150
Type Constructors ~ 155
Operator Overload Methods ~ 157
Operators and Programming Language Interoperability ~ 159
Conversion Operator Methods ~ 161
Passing Parameters by Reference to a Method ~ 164
Passing a Variable Number of Parameters to a Method ~ 168
How Virtual Methods Are Called ~ 170
Virtual Method Versioning ~ 171

Chapter 10: Properties ~ 176

Parameterless Properties ~ 176
Parameterful Properties ~ 179

Chapter 11: Events ~ 184

Overview ~ 184
Designing a Type That Exposes an Event ~ 185
Designing a Type That Listens for an Event ~ 189
Explicitly Controlling Event Registration ~ 191
Designing a Type That Defines Lots of Events ~ 192
Designing the EventHandlerSet Type ~ 196

Part IV: Essential Types ~ 199
Chapter List ~ 199

Chapter 12: Working with Text ~ 200

Characters ~ 200
The System.String Type ~ 202
Constructing Strings ~ 202
Strings Are Immutable ~ 204
Comparing Strings ~ 205
String Interning ~ 210
String Pooling ~ 213
Examining a String’s Characters ~ 213
Other String Operations ~ 216
Dynamically Constructing a String Efficiently ~ 217
Constructing a StringBuilder Object ~ 217
StringBuilder’s Members ~ 218
Obtaining a String Representation for an Object ~ 220
Specific Formats and Cultures ~ 221
Formatting Multiple Objects into a Single String ~ 224
Providing Your Own Custom Formatter ~ 226
Parsing a String to Obtain an Object ~ 228
Encodings: Converting Between Characters and Bytes ~ 232
Encoding/Decoding Streams of Characters and Bytes ~ 238
Base-64 String Encoding and Decoding ~ 239

Chapter 13: Enumerated Types and Bit Flags ~ 240

Enumerated Types ~ 240
Bit Flags ~ 244

Chapter 14: Arrays ~ 247

Overview ~ 247
All Arrays Are Implicitly Derived from System.Array ~ 249
Casting Arrays ~ 251
Passing and Returning Arrays ~ 252
Creating Arrays That Have a Nonzero Lower Bound ~ 253
Fast Array Access ~ 254
Redimensioning an Array ~ 257

Chapter 15: Interfaces ~ 259

Interfaces and Inheritance ~ 259
Designing an Application That Supports Plug-In Components ~ 263
Changing Fields in a Boxed Value Type Using Interfaces ~ 264
Implementing Multiple Interfaces That Have the Same Method ~ 266
Explicit Interface Member Implementations ~ 268

Chapter 16: Custom Attributes ~ 273

Using Custom Attributes ~ 273
Defining Your Own Attribute ~ 276
Attribute Constructor and Field/Property Data Types ~ 278
Detecting the Use of a Custom Attribute ~ 279
Matching Two Attribute Instances Against Each Other ~ 283
Pseudo-Custom Attributes ~ 285

Chapter 17: Delegates ~ 287

A First Look at Delegates ~ 287
Using Delegates to Call Back Static Methods ~ 289
Using Delegates to Call Back Instance Methods ~ 290
Demystifying Delegates ~ 291
Some Delegate History: System.Delegate and System.MulticastDelegate ~ 294
Comparing Delegates for Equality ~ 296
Delegate Chains ~ 296
C#’s Support for Delegate Chains ~ 300
Having More Control over Invoking a Delegate Chain ~ 301
Delegates and Reflection ~ 303

Part V: Managing Types ~ 306
Chapter List ~ 306

Chapter 18: Exceptions ~ 307

Overview ~ 307
The Evolution of Exception Handling ~ 307
The Mechanics of Exception Handling ~ 309
The try Block ~ 310
The catch Block ~ 310
The finally Block ~ 312
What Exactly Is an Exception? ~ 312
The System.Exception Class ~ 316
FCL-Defined Exception Classes ~ 317
Defining Your Own Exception Class ~ 319
How to Use Exceptions Properly ~ 322
You Can’t Have Too Many finally Blocks ~ 323
Don’t Catch Everything ~ 324
Gracefully Recovering from an Exception ~ 325
Backing Out of a Partially Completed Operation When an Unrecoverable Exception Occurs ~ 326
Hiding an Implementation Detail ~ 327
What’s Wrong with the FCL ~ 329
Performance Considerations ~ 330
Catch Filters ~ 333
Unhandled Exceptions ~ 335
Controlling What the CLR Does When an Unhandled Exception Occurs ~ 339
Unhandled Exceptions and Windows Forms ~ 340
Unhandled Exceptions and ASP.NET Web Forms ~ 342
Unhandled Exceptions and ASP.NET XML Web Services ~ 342
Exception Stack Traces ~ 342
Remoting Stack Traces ~ 344
Debugging Exceptions ~ 345
Telling Visual Studio What Kind of Code to Debug ~ 349

Chapter 19: Automatic Memory Management (Garbage Collection) ~ 351

Understanding the Basics of Working in a Garbage-Collected Platform ~ 351
The Garbage Collection Algorithm ~ 354
Finalization ~ 357
What Causes Finalize Methods to Get Called ~ 362
Finalization Internals ~ 363
The Dispose Pattern: Forcing an Object to Clean Up ~ 365
Using a Type That Implements the Dispose Pattern ~ 370
C#’s using Statement ~ 373
An Interesting Dependency Issue ~ 374
Weak References ~ 375
Weak Reference Internals ~ 377
Resurrection ~ 378
Designing an Object Pool Using Resurrection ~ 379
Generations ~ 381
Programmatic Control of the Garbage Collector ~ 385
Other Garbage Collector Performance Issues ~ 387
Synchronization-Free Allocations ~ 388
Scalable Parallel Collections ~ 388
Concurrent Collections ~ 389
Large Objects ~ 390
Monitoring Garbage Collections ~ 391

Chapter 20: CLR Hosting, AppDomains, and Reflection ~ 392

Metadata: The Cornerstone of the .NET Framework ~ 392
CLR Hosting ~ 393
AppDomains ~ 394
Accessing Objects Across AppDomain Boundaries ~ 396
AppDomain Events ~ 397
Applications and How They Host the CLR and Manage AppDomains ~ 398
"Yukon" ~ 399
The Gist of Reflection ~ 400
Reflecting Over an Assembly’s Types ~ 401
Reflecting Over an AppDomain’s Assemblies ~ 403
Reflecting Over a Type’s Members: Binding ~ 404
Explicitly Loading Assemblies ~ 405
Loading Assemblies as "Data Files" ~ 407
Building a Hierarchy of Exception-Derived Types ~ 408
Explicitly Unloading Assemblies: Unloading an AppDomain ~ 410
Obtaining a Reference to a System.Type Object ~ 412
Reflecting Over a Type’s Members ~ 415
Creating an Instance of a Type ~ 417
Calling a Type’s Method ~ 418
Bind Once, Invoke Multiple Times ~ 422
Reflecting Over a Type’s Interfaces ~ 426
Reflection Performance ~ 428

List of Figures ~ 429

List of Tables ~ 432