C# - OReilly Programming C#.pdf

(3117 KB) Pobierz
Microsoft Word - Programming C# -- oreilly.doc
Release TeamOR
[x] .NET
781427.001.png 781427.002.png
...............................................................................
About This Book
2
.............................................................
How the Book Is Organized
2
............................................
2
.....................................................
C# Versus Visual Basic .NET
5
.........................................
5
C# Versus Java
..............................................................
5
................................................................
Conventions Used in This Book
5
......................................
6
...........................................................................
We’d Like to Hear from You
6
............................................
7
Acknowledgements
.........................................................
7
Part I: The C# Language
...................................................
8
Chapter 1. C# and the .NET Framework
..........................
8
..........................................................
The .NET Framework
8
.....................................................
Compilation and the MSIL
9
..............................................
10
The C# Language
...........................................................
11
Chapter 2. Getting Started:"Hello World"
.......................
12
Classes, Objects, and Types
..........................................
12
Developing "Hello World"
................................................
17
.................................................
Using the Visual Studio .NET Debugger
.........................
20
Chapter 3. C# Language Fundamentals
.........................
22
Types
..............................................................................
23
...................................................
Variables and Constants
.................................................
24
........................................................................
Expressions
26
....................................................................
32
Whitespace
.....................................................................
32
Statements
......................................................................
33
Statement Blocks
..............................................................
36
All Operators Are Not Created Equal
..............................
37
Whitespace and Braces
....................................................
43
Operators
........................................................................
46
Preface
Who This Book Is For
C# versus C++
Support
The .NET Platform
Just In Time Compilation
20
The Stack and the Heap
26
WriteLine( )
Short-Circuit Evaluation
...................................................
51
...................................................................
Preprocessor Directives
53
..................................................
54
Chapter 4. Classes and Objects
......................................
57
Defining Classes
.............................................................
58
.............................................................
Using Static Members
62
.....................................................
67
Static Methods to Access Static Fields
..........................
70
Destroying Objects
.........................................................
70
..........................................................
Passing Parameters
71
.......................................................
Overloading Methods and Constructors
73
.........................
77
Encapsulating Data with Properties
................................
80
Readonly Fields
..............................................................
82
Chapter 5. Inheritance and Polymorphism
.....................
83
Specialization and Generalization
..................................
84
About the Unified Modeling Language
...........................
84
......................................................................
Polymorphism
86
.................................................................
Abstract Classes
89
.............................................................
The Root of all Classes: Object
94
......................................
97
Boxing and Unboxing Types
...........................................
99
Nesting Classes
..............................................................
101
..............................................................
Using the operator Keyword
102
...........................................
Supporting Other .NET Languages
104
................................
105
Creating Useful Operators
..............................................
105
...................................................................
The Equals Operator
105
......................................................
Conversion Operators
105
.....................................................
106
Chapter 7. Structs
.............................................................
111
Defining Structs
..............................................................
111
Creating Structs
..............................................................
113
Chapter 8. Interfaces
........................................................
117
................................................................................
Implementing an Interface
..............................................
117
Namespaces
Creating Objects
How Finalize Works
Inheritance
Nesting Classes
Logical Pairs
Mix Ins
117
..........................................
Overriding Interface Implementations
127
.............................
133
Explicit Interface Implementation
....................................
136
Chapter 9. Arrays, Indexers, and Collections
................
144
.............................................................................
The foreach Statement
144
...................................................
148
..........................................................................
Collection Interfaces
160
.......................................................
168
Array Lists
.......................................................................
172
Queues
...........................................................................
182
.............................................................................
Dictionaries
184
.....................................................................
187
Load Factor
.......................................................................
188
Chapter 10. Strings and Regular Expressions
...............
192
Strings
.............................................................................
192
........................................................
Regular Expressions
.......................................................
205
....................................
Throwing and Catching Exceptions
214
................................
215
...........................................................
Custom Exceptions
223
.........................................................
Rethrowing Exceptions
225
...................................................
227
Chapter 12. Delegates and Events
..................................
230
Delegates
........................................................................
231
Events
.............................................................................
248
Chapter 13. Building Windows Applications
..................
256
..................................
Creating a Windows Form Application
257
............................
268
..........................................
XML Documentation Comments
.....................................
274
Chapter 14. Accessing Data with ADO.NET
...................
289
Relational Databases and SQL
......................................
290
............................................
Getting Started with ADO.NET
293
.......................................
Using ADO Managed Providers
294
......................................
Working with Data-Bound Controls
297
.................................
300
Accessing Interface Methods
Arrays
Indexers
Stacks
Delimiter Limitations
205
Chapter 11. Handling Exceptions
Exception Objects
Creating a Simple Windows Form
It’s Turtles, All the Way Down
288
The ADO.Net Object Model
Changing Database Records
..........................................
309
ADO.NET and XML
........................................................
322
........................................................................
Understanding Web Forms
322
.............................................
322
Creating a Web Form
.....................................................
325
Adding Controls
..............................................................
328
...................................................................
Responding to Postback Events
330
.....................................
337
ASP.NET and C#
............................................................
339
Chapter 16. Programming Web Services
........................
339
SOAP, WSDL, and Discovery
.........................................
339
Building a Web Service
...................................................
340
WSDL and Namespaces
...................................................
342
Creating the Proxy
..........................................................
346
Part III: C# and the .NET CLR
...........................................
349
Chapter 17. Assemblies and Versioning
........................
349
..........................................................................
Metadata
349
.........................................................................
Security Boundary
349
..........................................................
350
Versioning
.......................................................................
350
........................................................................
Multi-Module Assemblies
350
................................................
352
Private Assemblies
.........................................................
359
Shared Assemblies
.........................................................
359
Public Key Encryption
......................................................
361
Chapter 18. Attributes and Reflection
.............................
364
.........................................................................
Intrinsic Attributes
364
...........................................................
365
Custom Attributes
...........................................................
366
........................................................................
Reflection Emit
370
................................................................
379
Chapter 19. Marshaling and Remoting
...........................
400
Application Domains
.......................................................
401
...........................................................................
Remoting
409
........................................................................
411
Chapter 15. ProgrammingWeb Applications with
Web Forms
Data Binding
PE Files
Manifests
Attributes
Reflection
Context
Zgłoś jeśli naruszono regulamin