Book description
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 C# programming language, and he feels that this fifth edition of the book is as close to a "final release" as he's come yet.
This new edition has been comprehensively revised and rewritten to make it accurately reflect the C# 4 language specification for the .NET 4 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.
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 C# 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 you'll be well equipped to explore the .NET universe on your own terms.
Table of contents
- Copyright
- Dedication
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
-
Introducing C# and the .NET Platform
-
The Philosophy of .NET
- Understanding the Previous State of Affairs
- The .NET Solution
- Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS)
- Additional .NET-Aware Programming Languages
- An Overview of .NET Assemblies
- Understanding the Common Type System
- Understanding the Common Language Specification
- Understanding the Common Language Runtime
- The Assembly/Namespace/Type Distinction
- Exploring an Assembly Using ildasm.exe
- Exploring an Assembly Using Reflector
- Deploying the .NET Runtime
- The Platform-Independent Nature of .NET
- Summary
- Building C# Applications
-
The Philosophy of .NET
-
Core C# Programming Constructs
-
Core C# Programming Constructs, Part I
- The Anatomy of a Simple C# Program
- An Interesting Aside: Some Additional Members of the System.Environment Class
- The System.Console Class
- System Data Types and C# Shorthand Notation
- Working with String Data
- Narrowing and Widening Data Type Conversions
- Understanding Implicitly Typed Local Variables
- C# Iteration Constructs
- Decision Constructs and the Relational/Equality Operators
- Summary
- Core C# Programming Constructs, Part II
-
Defining Encapsulated Class Types
- Introducing the C# Class Type
- Understanding Constructors
- The Role of the this Keyword
- Understanding the static Keyword
- Defining the Pillars of OOP
- C# Access Modifiers
- The First Pillar: C#'s Encapsulation Services
- Understanding Automatic Properties
- Understanding Object Initializer Syntax
- Working with Constant Field Data
- Understanding Partial Types
- Summary
-
Understanding Inheritance and Polymorphism
- The Basic Mechanics of Inheritance
- Revising Visual Studio Class Diagrams
- The Second Pillar of OOP: The Details of Inheritance
- Programming for Containment/Delegation
- The Third Pillar of OOP: C#'s Polymorphic Support
- Understanding Base Class/Derived Class Casting Rules
- The Master Parent Class: System.Object
- Summary
-
Understanding Structured Exception Handling
- Ode to Errors, Bugs, and Exceptions
- The Role of .NET Exception Handling
- The Simplest Possible Example
- Configuring the State of an Exception
- System-Level Exceptions (System.SystemException)
- Application-Level Exceptions (System.ApplicationException)
- Processing Multiple Exceptions
- Who Is Throwing What?
- The Result of Unhandled Exceptions
- Debugging Unhandled Exceptions Using Visual Studio
- A Brief Word Regarding Corrupted State Exceptions (CSE)
- Summary
-
Understanding Object Lifetime
- Classes, Objects, and References
- The Basics of Object Lifetime
- The Role of Application Roots
- Understanding Object Generations
- Concurrent Garbage Collection under .NET 1.0 – 3.5
- The System.GC Type
- Building Finalizable Objects
- Building Disposable Objects
- Building Finalizable and Disposable Types
- Understanding Lazy Object Instantiation
- Summary
-
Core C# Programming Constructs, Part I
-
Advanced C# Programming Constructs
-
Working with Interfaces
- Understanding Interface Types
- Defining Custom Interfaces
- Implementing an Interface
- Invoking Interface Members at the Object Level
- Interfaces As Parameters
- Interfaces As Return Values
- Arrays of Interface Types
- Implementing Interfaces Using Visual Studio 2010
- Resolving Name Clashes via Explicit Interface Implementation
- Designing Interface Hierarchies
- Building Enumerable Types (IEnumerable and IEnumerator)
- Building Cloneable Objects (ICloneable)
- Building Comparable Objects (IComparable)
- Summary
- Understanding Generics
-
Delegates, Events, and Lambdas
- Understanding the .NET Delegate Type
- Defining a Delegate Type in C#
- The System.MulticastDelegate and System.Delegate Base Classes
- The Simplest Possible Delegate Example
- Sending Object State Notifications using Delegates
- Method Group Conversion Syntax
- Understanding Delegate Covariance
- Understanding Generic Delegates
- Understanding C# Events
- Understanding C# Anonymous Methods
- Understanding Lambda Expressions
- Summary
- Advanced C# Language Features
- LINQ to Objects
-
Working with Interfaces
-
Programming with .NET Assemblies
-
Configuring .NET Assemblies
- Defining Custom Namespaces
- The Role of .NET Assemblies
- Understanding the Format of a .NET Assembly
- Building and Consuming a Single-File Assembly
- Building and Consuming a Multifile Assembly
- Understanding Private Assemblies
- Understanding Shared Assemblies
- Consuming a Shared Assembly
- Configuring Shared Assemblies
- Understanding Publisher Policy Assemblies
- Understanding the <codeBase> Element
- The System.Configuration Namespace
- Summary
-
Type Reflection, Late Binding, and Attribute-Based Programming
- The Necessity of Type Metadata
- Understanding Reflection
- Building a Custom Metadata Viewer
- Dynamically Loading Assemblies
- Reflecting on Shared Assemblies
- Understanding Late Binding
- Understanding the Role of .NET Attributes
- Building Custom Attributes
- Assembly-Level (and Module-Level) Attributes
- Reflecting on Attributes Using Early Binding
- Reflecting on Attributes Using Late Binding
- Putting Reflection, Late Binding, and Custom Attributes in Perspective
- Building an Extendable Application
- Summary
- Processes, AppDomains, and Object Contexts
-
Understanding CIL and the Role of Dynamic Assemblies
- Reasons for Learning the Grammar of CIL
- Examining CIL Directives, Attributes, and Opcodes
- Pushing and Popping: The Stack-Based Nature of CIL
- Understanding Round-Trip Engineering
- Understanding CIL Directives and Attributes
- .NET Base Class Library, C#, and CIL Data Type Mappings
- Defining Type Members in CIL
- Examining CIL Opcodes
- Building a .NET Assembly with CIL
- Understanding Dynamic Assemblies
- Summary
- Dynamic Types and the Dynamic Language Runtime
-
Configuring .NET Assemblies
-
Introducing the .NET Base Class Libraries
-
Multithreaded and Parallel Programming
- The Process/AppDomain/Context/Thread Relationship
- A Brief Review of the .NET Delegate
- The Asynchronous Nature of Delegates
- Invoking a Method Asynchronously
- The System.Threading Namespace
- The System.Threading.Thread Class
- Programmatically Creating Secondary Threads
- The Issue of Concurrency
- Programming with Timer Callbacks
- Understanding the CLR ThreadPool
- Parallel Programming under the .NET Platform
- Parallel LINQ Queries (PLINQ)
- Summary
-
File I/O and Object Serialization
- Exploring the System.IO Namespace
- The Directory(Info) and File(Info) Types
- Working with the DirectoryInfo Type
- Working with the Directory Type
- Working with the DriveInfo Class Type
- Working with the FileInfo Class
- Working with the File Type
- The Abstract Stream Class
- Working with StreamWriters and StreamReaders
- Working with StringWriters and StringReaders
- Working with BinaryWriters and BinaryReaders
- Watching Files Programmatically
- Understanding Object Serialization
- Configuring Objects for Serialization
- Choosing a Serialization Formatter
- Serializing Objects Using the BinaryFormatter
- Serializing Objects Using the SoapFormatter
- Serializing Objects Using the XmlSerializer
- Serializing Collections of Objects
- Customizing the Soap/Binary Serialization Process
- Summary
-
ADO.NET Part I: The Connected Layer
- A High-Level Definition of ADO.NET
- Understanding ADO.NET Data Providers
- Additional ADO.NET Namespaces
- The Types of the System.Data Namespace
- Abstracting Data Providers Using Interfaces
- Creating the AutoLot Database
- The ADO.NET Data Provider Factory Model
- Understanding the Connected Layer of ADO.NET
- Working with Data Readers
- Building a Reusable Data Access Library
- Creating a Console UI–Based Front End
- Understanding Database Transactions
- Summary
-
ADO.NET Part II: The Disconnected Layer
- Understanding the Disconnected Layer of ADO.NET
- Understanding the Role of the DataSet
- Working with DataColumns
- Working with DataRows
- Working with DataTables
- Binding DataTable Objects to Windows Forms GUIs
- Working with Data Adapters
- Adding Disconnection Functionality to AutoLotDAL.dll
- Multitabled DataSet Objects and Data Relationships
- The Windows Forms Database Designer Tools
- Isolating Strongly Typed Database Code into a Class Library
- Programming with LINQ to DataSet
- Summary
- ADO.NET Part III: The Entity Framework
- Introducing LINQ to XML
-
Introducing Windows Communication Foundation
- A Potpourri of Distributed Computing APIs
- The Role of WCF
- Investigating the Core WCF Assemblies
- The Visual Studio WCF Project Templates
- The Basic Composition of a WCF Application
- The ABCs of WCF
- Building a WCF Service
- The [ServiceContract] Attribute
- Hosting the WCF Service
- Building the WCF Client Application
- Simplifying Configuration Settings with WCF 4.0
- Using the WCF Service Library Project Template
- Hosting the WCF Service within a Windows Service
- Invoking a Service Asynchronously from the Client
- Designing WCF Data Contracts
- Summary
- Introducing Windows Workflow Foundation 4.0
-
Multithreaded and Parallel Programming
-
Building Desktop User Interfaces with WPF
-
Introducing Windows Presentation Foundation and XAML
- The Motivation Behind WPF
- The Various Flavors of WPF
- Investigating the WPF Assemblies
- Building a WPF Application without XAML
- Building a WPF Application using Only XAML
- Transforming Markup into a .NET Assembly
- Understanding The Syntax of WPF XAML
- Building a WPF Application using Code-Behind Files
- Building WPF Applications Using Visual Studio 2010
- Summary
-
Programming with WPF Controls
- A Survey of the Core WPF Controls
- Controlling Content Layout Using Panels
- Building a Window's Frame Using Nested Panels
- Understanding WPF Control Commands
- Building a WPF User Interface with Expression Blend
- Building the Ink API Tab
- Introducing the Documents API
- Building the Documents Tab
- Introducing the WPF Data-Binding Model
- Summary
-
WPF Graphics Rendering Services
- Understanding WPF's Graphical Rendering Services
- Rendering Graphical Data Using Shapes
- WPF Brushes and Pens
- Applying Graphical Transformations
- Working with Shapes using Expression Blend
- Rendering Graphical Data Using Drawings and Geometries
- Generating Complex Vector Graphics using Expression Design
- Rendering Graphical Data Using the Visual Layer
- Summary
- WPF Resources, Animations, and Styles
-
WPF Control Templates and UserControls
- Understanding the Role of Dependency Properties
- Building a Custom Dependency Property
- Understanding Routed Events
- Logical Trees, Visual Trees and Default Templates
- Building a Custom Control Template with Visual Studio 2010
- Building Custom UserControls with Blend
- Creating the Jackpot Deluxe WPF Application
- Summary
-
Introducing Windows Presentation Foundation and XAML
-
Building Web Applications with ASP.NET
-
Building ASP.NET Web Pages
- The Role of HTTP
- Understanding Web Applications and Web Servers
- The Role of HTML
- The Role of Client-Side Scripting
- Posting Back to the Web Server
- The Feature Set of the ASP.NET API
- Building a Single File ASP.NET Web Page
- Building an ASP.NET Web Page using Code Files
- ASP.NET Web Sites and ASP.NET Web Applications
- The ASP.NET Web Site Directory Structure
- The Inheritance Chain of the Page Type
- Interacting with the Incoming HTTP Request
- Interacting with the Outgoing HTTP Response
- The Life Cycle of an ASP.NET Web Page
- The Role of the Web.config File
- Summary
- ASP.NET Web Controls, Master Pages and Themes
-
ASP.NET State Management Techniques
- The Issue of State
- ASP.NET State Management Techniques
- Understanding the Role of ASP.NET View State
- The Role of the Global.asax File
- Understanding the Application/Session Distinction
- Working with the Application Cache
- Maintaining Session Data
- Understanding Cookies
- The Role of the <sessionState> Element
- Understanding the ASP.NET Profile API
- Summary
-
Building ASP.NET Web Pages
- Programming with Windows Forms
- Platform-Independent .NET Development with Mono
- Index
Product information
- Title: Pro C# 2010 and the .NET 4 Platform, Fifth Edition
- Author(s):
- Release date: May 2010
- Publisher(s): Apress
- ISBN: 9781430225492
You might also like
book
Professional C# 5.0 and .NET 4.5.1
Comprehensive, advanced coverage of C# 5.0 and .NET 4.5.1 Whether you're a C# guru or transitioning …
book
Microsoft® Windows® Internals: Microsoft Windows Server™ 2003, Windows XP, and Windows 2000, 4th Edition
The premier guide to the Windows kernel now covers Windows Server 2003, Windows XP, and Windows …
book
C# 6.0 and the .NET 4.6 Framework, Seventh Edition
This new 7th edition of Pro C# 6.0 and the .NET 4.6 Platform has been completely …
book
Microsoft® Windows Server™ 2003 Inside Out
Designed for system administrators, this definitive, supremely organized reference delivers in-depth solutions, tips, and tools for …