作者:empty 页数:1635 出版社:empty |
A ie msn semi one din his beck that are kno an to be trade mars s or service makshave been appropriately capital zed.Pearson Education, Inc.can not attest to the a courat y of this informe tion.Use of a term in this book should not be regarded as affect ngthey al dity of amy trademark or servicemark.Warning and DisclaimerEvery effort hss been made to make this book as complete and as accurate as possble.but no warranty or ft ness is implied.The information provided is on an“as isperson or entity with respect to any loss or damages arising from the informationcontanedinthsbouk.
Bulk SalesPearson offers excellent discounts on this book wher ordered in quantity for bukp urth ases or specials aes.For more infomation, please contact:U.s.Corporate and Govemment Sales
IntroductionWow le Book Wow eBook.Com>Wow!eBook Wow eBook.Com?Who Should Read This Book?What You Need to Know Before You Read This BookHow This Book Is Organized1Introduaing the.NET PlatformA Historical PerspectiveWin 32 Programming inCRaising the Abstraction Level with MFC and C++Component-Driven Development with COMWindows Development for the Masses in VisualBasicReaching Out to the Web with Windows DNAReaching Out to Java with J++
Introduction
Part l
Part II
Introducing the, NET Platform
Introducing the Cr Programming Language
GettingStarted with NET Development Using C#
C#-The Language
Language Essentials
Expressions and Operators
6A Primer on Types and Objects
Simple Control Flow
Basics of Exceptions and Resource Management
Introducing Types
Methods
11Fields, Properties, and Indexers
12Constructors and Finalizers
13Operator Overloading and Conversions
14Object-Or lent ed Programming
15Generic Types and Methods
16Collection Types
17Delegates
Part i Introduction
Part III Working with BaseClass Libraries
26BaseClass Library Essentials
27Diagnostics and Instrumentation
28Working with I/O
29Threading and Synchronization
30Task Parallelism and Data Parallelism
The BaseClass Library
Summary
A Sneak Peek at the Future
2 Introducing the Ca Programming Language
The Evolution of Cu
Installing the.NET Framework
Your First Application:Take One
Your First Application:Take Two
The EntryPoint
Keywords
A Primer on Types
Built-In Types
Local Variables
CU 1.0:Managed Code Development, Take One
C+2.0:Enriching the Core Language Features
C#3.0.Bridging the Gap Between Objects and Data
CH 4.0:Reaching Out to Dynamic Languages
Multi paradigm
Language-Shaping Forces
Compiler as a Service
Taming the Concurrency Beast
Summary
Implicitly Typed Local Variable Declarations
Single-Line Comments
A Primer to Preprocessing Directives
Delimited Comments
Documentation Comments
Internal Representation
Single-Dimensional A trays
Array Initializers
Jagged Arrays
Multidimensional A trays
What'Null Really?
A Common Source of Bugs
Internal Representation
Use inC#
A Type Background
Arity of Operators
Precedence and Assoc la tivity
Evaluation of Subexpressions
Integer Arithmetic
Floating-Point Arithmetic
Decimal Arithmetic
Character Arithmetic
Unary Plus and Minus
Overflow Checking
Arithmetic with Nullable s
Equality for Different Types
Lifted Operators
Integral Bitwise Logical Operators
Use for Enumerations
Boolean Logical Operators
Nullable Boolean Logic
Under the Hood
Associativity
Dec aration Versus(Simple) Assignment
Compound Assignment
A Gentle Introduction to Definite Assignment
Cast Expressions
The is Operator
The as Operator
Intermezzo:The Mythical Type Switch
Behind the Scenes of Constructors
Object Initializers
Collection Initializers
A First Look at Dynamic Typing
Method Invocation
Delegate Invocation
Method Calls
Assignments
Pre-and Post-Increment/Decrement
Intermezzo on Comments
A trays
The Null Reference
Nullable Value Types
Summary
The if Statement
The switch Statement
The while Statement
The do., whil a Statement
The for Stater nent
The for each Statement
Exceptions Are Objects
Causes of Exceptions
Throwing Exceptions
Handling Exceptions
The finally Clause
Garbage Collection in a Nutshell
Object DIsposal.
The using Statement
Implementing IDisposable
(In) approp nate Use of IDisposable
Under the Hood
The lock Statement
Intermezzo:Code Generation for Lock
Be Careful with Locks
References Versus Values
Heap Versus Stack
The Dangers of Mutable Value Types
Visibility
Static Versus Instance
Partial Types
Value Parameters
Reference Parameters
Output Parameters
Parameter Arrays
Optional and Named Parameters
Defining Method Overloads
Method Groups
Overload Resolution
Defining Extension Methods
Overload Resolution
Using Extension Methods
Declaring Fields
Accessing Fields
Initializing Fields
Read-Only Fields
Constants
Volatile Fields
Why Enums Matter
Underlying Types
Loops in the Age of Concurrency
The goto Statement
The return Statement
Summary
Classes Versus Structs
Boxing
Defining Methods
Re tum Type
Parameters
overloading
Extension Methods
Partial Methods
Exte mn Methods
Refactoring
Code Analysis
Fields
An Intermezzo About Enums
8 Basics of Exceptions and Resource Management
Exception Handling
Deterministic Resource Cleanup
Locking on Objects
Summary
Properties
Indexers
Summary
Constructors
Static Constructors
12 Constructors and Finalizers
Destructors(Poorly Named Finalizers)
Summary
Operators
Convers lons
The Cornerstones of ObjectOr entation
Inheritance for Classes
Protected Accessibility
Polymorph im and Virtual Me rn bers
Abstract Classes
Inter t aces
Life Without Generics
GettingStarted with Generics
Declaring Gene rc Types
Using Gene ntc Types
Performance Intermezzo
Operations on Type Parameters
Generic Constraints
Generic Methods
Co-and Contra variance
13 Operator Overloading and Conversions
Summary
14 Object-Or lent ed Programming
Summary
15 Generic Types and Methods
Wow!eBook Wow eBook.Com>
Wow!eBook Wow eBook.Com?
Contents
xiv
C#4.0 Unleashed
16 Collection Types
Safety Guarantees
ArrayList
HashTables
Stack
Historical Perspective
Programming with Functions
Anonymous Function Expressions
Closures:Captured Outer
Variables
Lambda Expressions
Expression Trees
Using Delegates
Limitations on Plain Use of Delegates
Using.NET Events
EventHandler and EventArgs
EventHandler T>
Designing Events for Use by Derived Classes
Events in UI Frameworks
Events Revisited
Pull Versus Push
Dictionary Suggest Revisited
In-Memory Data
Relational Databases
The Birth of LINQ
In-Memory Data
Relational Databases
Why Query Expressions?
GettingStarted
Source Selection Using a from Clause
Projection Using the Select Clause
Filtering Using a where Clause
Ordering Using the order by Keyword
Grouping Using the group by Clause
Generic Co-and Contra variance
Under the Hood
Where to Use
Summary
Non generic Collection Types
Queue
summary
Generic Collection Types
List T
Other Collec on Types
Functional Programming
What Are Delegates?
Delegate Types
Delegate Instances
Invoking Delegates
Putting It Together:An Extensible
Calculator
Case Study:Delegates Used in LINQ
to Objects
Asynchronous Invocation
Combining Delegates
The Two Sides of Delegates
ARe active Application
How Events Work
Raising Events, the Correct Way
Add and Remove Accessors
Detach Your Event Handlers
Recommended Event Patterns
Case Study:I Notify Property Interfaces and
UI Programming
Countdown, the GUI Way
Modern Approaches to Reactive Programming
Life Without LINQ
XML
LINQ by Example
XML
Query Expression Syntax
Sorted Dictionary T Key, T value>
and Sorted List T Key, T Value>
Queue T>and Stack-T>
Summary
Life Without Exceptions
Introducing Exceptions
Exception Handling
Throwing Exceptions
Organizing Types in Namespaces
Declaring Namespaces
Importing Namespaces
Assemblies
Application Domains
The BCL:What.Where, and How?
Win 32
COM
Lessons Learned
try Statements
First-Chance Exceptions
Intermezzo on Historical Debugging
with Intelli Trace
When and What to Catch
Beyond Your Control
D1V1deByZero Exception
Overflow Exception
Null Re terence Exception
Index Out Of Range Exception
Invalid Cast Exception
ArrayType Mismatch Exception
Type Initialization Exception
0bject Disposed Exception
Out Of Men or y Exception
Stack Overflow Exception
ExecutionEngine Exception
Argun ent Exception
Argun ent Null Exception
Argun ent out Of Range Exception
Invalid Operation Exception
Not Imple n ented Exception
Not Supported Exception
For nat Exception
Aggregate Exception
Once Upon a Time
Assemblies and Namespaces
Naming Conventions
Visibility
Name Clashes Within Namespaces
Name Clashes Due to Imports
Using Aliases
Exter Aliases
Extension Methods
Modules and Assemblies
Types of Assemblies
Assembly Properties
Naming.Versioning, and Deployment
Strong Naming
The Global Assembly Cache
Referencing Assemblies
How Assemblies Get Loaded at Runtime
Native Image Generation(NGEN)
Visibility Aspects
Embedded Resources
Type Forwarding
Reflection Flashback
Creating Application Domains
Cross-Domain Communication
The Managed Add-In Framework
What Is Covered?
Default Project References
Namespaces Versus Assemblies
The Systenandnscorl1b Assemblies
System.Core'Story of Red Bits and Green Bits
Defining Your Own Exception Types
(In) famous Exception