Tải bản đầy đủ (.pdf) (98 trang)

Addison essential C# 4.0 Visual Studio_1 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.8 MB, 98 trang )

ptg
Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City
Essential
C# 4.0
Mark Michaelis
From the Library of Wow! eBook
ptg
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and the publisher was aware of a trade-
mark claim, the designations have been printed with initial capital letters or in all capitals.
The .NET logo is either a registered trademark or trademark of Microsoft Corporation in the United
States and/or other countries and is used under license from Microsoft.
Microsoft, Windows, Visual Basic, Visual C#, and Visual C++ are either registered trademarks or trade-
marks of Microsoft Corporation in the U.S.A. and/or other countries/regions.
The author and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or
special sales, which may include electronic versions and/or custom covers and content particular to
your business, training goals, marketing focus, and branding interests. For more information, please
contact:
U.S. Corporate and Government Sales
(800) 382-3419

For sales outside the United States, please contact:
International Sales

Visit us on the Web: informit.com/aw


Library of Congress Cataloging-in-Publication Data
Michaelis, Mark.
Essential C# 4.0 / Mark Michaelis.
p. cm.
Includes index.
ISBN 978-0-321-69469-0 (pbk. : alk. paper)
1. C# (Computer program language) I. Title.
QA76.73.C154M5237 2010
005.13’3—dc22
2009052592
Copyright © 2010 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright,
and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a
retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying,
recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax: (617) 671-3447
ISBN-13: 978-0-321-69469-0
ISBN-10: 0-321-69469-4
Text printed in the United St ates on recycled pap er at Edwards Brothers in Ann Arbor, Michigan.
First printing, March 2010
From the Library of Wow! eBook
ptg
To my f am il y: E li sa be th , Benja mi n, H an na , an d Ab ig ail.
You h av e sa cr ific ed a h us band a nd d addy f or c ou ntle ss h ou rs o f wri ti ng ,
frequently at times when he was needed most.
Thanks!

From the Library of Wow! eBook
ptg
This page intentionally left blank
From the Library of Wow! eBook
ptg
ix
Contents at a Glance
Contents xi
Contents of C# 4.0 Topics xxv
Figures xxvii
Ta bl es xxix
Foreword xxxi
Preface xxxv
Acknowledgments xlvii
About the Author li
1 Introducing C# 1
2 Data Types 31
3 Operators and Control Flow 83
4 Methods and Parameters 149
5 Classes 201
6 Inheritance 269
7 Interfaces 305
8 Value Types 331
9 Well-Formed Types 357
10 Exception Handling 405
11 Generics 421
12 Delegates and Lambda Expressions 469
From the Library of Wow! eBook
ptg
Contents of C# 4.0 Topicsx

13 Events 507
14 Collection Interfaces with Standard Query Operators 535
15 LINQ with Query Expressions 589
16 Building Custom Collections 611
17 Reflection, Attributes, and Dynamic Programming 651
18 Multithreading 701
19 Synchronization and More Multithreading Patterns 749
20 Platform Interoperability and Unsafe Code 815
21 The Common Language Infrastructure 843
A Downloading and Installing the C# Compiler and the
CLI Platform 865
B Full Source Code Listings 869
C Concurrent Classes from System. Collections. Concurrent 895
D C# 2.0 Topics 899
E C# 3.0 Topics 903
F C# 4.0 Topics 905
Index 907
From the Library of Wow! eBook
ptg
xi
Contents of C# 4.0 Topics xxv
Figures xxvii
Ta bl es x xi x
Foreword xxxi
Preface xxxv
Acknowledgments xlvii
About the Author li
1 Introducing C# 1
Hello, World 2
Compiling and Running the Application 3

C# Syntax Fundamentals 4
Type Definition 7
Main 8
Statements and Statement Delimiters 10
Whitespace 11
Working with Variables 12
Data Types 13
Declaring a Variable 14
Assigning a Variable 14
Using a Variable 16
Console Input and Output 16
Getting Input from the Console 16
Writing Output to the Console 18
Comments 20
Managed Execution and the Common Language Infrastructure 23
Contents
From the Library of Wow! eBook
ptg
Contentsxii
C# and .NET Versioning 26
Common Intermediate Language and ILDASM 27
Summary 30
2 Data Types 31
Fundamental Numeric Types 32
Integer Types 32
Floating-Point Types (float, double) 33
Decimal Type 34
Literal Values 35
More Fundamental Types 40
Boolean Type (bool) 40

Character Type (char) 41
Strings 43
null and void 51
null 51
The void Nontype 52
Categories of Types 55
Value Types 55
Reference Types 56
Nullable Modifier 57
Conversions between Data Types 58
Explicit Cast 58
Implicit Conversion 62
Type Conversion without Casting 62
Arrays 64
Declaring an Array 65
Instantiating and Assigning Arrays 66
Using an Array 70
Strings as Arrays 76
Common Errors 78
Summary 81
3 Operators and Control Flow 83
Operators 84
Plus and Minus Unary Operators (+, -) 84
Arithmetic Binary Operators (+, -, *, /, %) 85
Parenthesis Operator 92
Assignment Operators (+=, -=, *=, /=, %=) 93
Increment and Decrement Operators (++, ) 94
Constant Expressions (const) 98
From the Library of Wow! eBook
ptg

Contents xiii
Introducing Flow Control 98
if Statement 102
Nested if 103
Code Blocks ({}) 105
Scope and Declaration Space 107
Boolean Expressions 109
Relational and Equality Operators 110
Logical Boolean Operators 111
Logical Negation Operator (!) 113
Conditional Operator (?) 113
Null Coalescing Operator (??) 114
Bitwise Operators (<<, >>, |, &, ^, ~) 115
Shift Operators (<<, >>, <<=, >>=) 116
Bitwise Operators (&, |, ^) 117
Bitwise Assignment Operators (&=, |=, ^=) 120
Bitwise Complement Operator (~) 120
Control Flow Statements, Continued 121
The while and do/while Loops 121
The for Loop 124
The foreach Loop 127
The switch Statement 130
Jump Statements 132
The break Statement 132
The continue Statement 135
The goto Statement 137
C# Preprocessor Directives 138
Excluding and Including Code (#if, #elif, #else, #endif) 140
Defining Preprocessor Symbols (#define, #undef) 141
Emitting Errors and Warnings (#error, #warning) 141

Tur nin g O ff War nin g Me ssag es (#pragma) 142
nowarn:<warn list> Option 143
Specifying Line Numbers (#line) 143
Hints for Visual Editors (#region, #endregion) 144
Summary 145
4 Methods and Parameters 149
Calling a Method 150
Namespace 152
Type Name 154
Scope 155
Method Name 155
Parameters 155
From the Library of Wow! eBook
ptg
Contentsxiv
Method Return 155
Statement versus Method Call 156
Declaring a Method 157
Parameter Declaration 159
Method Return Declaration 159
The using Directive 161
Aliasing 164
Returns and Parameters on Main() 165
Parameters 168
Value Parameters 168
Reference Parameters (ref) 170
Output Parameters (out) 171
Parameter Arrays (params) 173
Recursion 176
Method Overloading 179

Optional Parameters 182
Basic Error Handling with Exceptions 186
Tra ppin g E rrors 18 7
Reporting Errors Using a throw Statement 196
Summary 199
5 Classes 201
Declaring and Instantiating a Class 205
Instance Fields 209
Declaring an Instance Field 209
Accessing an Instance Field 210
Instance Methods 211
Using the this Keyword 213
Access Modifiers 220
Properties 222
Declaring a Property 223
Automatically Implemented Properties 225
Naming Conventions 227
Using Properties with Validation 228
Read-Only and Write-Only Properties 230
Access Modifiers on Getters and Setters 231
Properties as Virtual Fields 232
Properties and Method Calls Not Allowed as ref or out
Parameter Values 234
Constructors 236
Declaring a Constructor 237
Default Constructors 239
Object Initializers 239
From the Library of Wow! eBook
ptg
Contents xv

Overloading Constructors 241
Constructor Chaining: Calling another
Constructor Using this 243
Static Members 247
Static Fields 248
Static Methods 251
Static Constructors 253
Static Properties 254
Static Classes 255
Extension Methods 256
Encapsulating the Data 258
const 258
readonly 259
Nested Classes 260
Partial Classes 262
Defining a Partial Class 263
Partial Methods 264
Summary 267
6 Inheritance 269
Derivation 270
Casting between Base and Derived Types 272
private Access Modifier 275
protected Access Modifier 276
Extension Methods 278
Single Inheritance 278
Sealed Classes 281
Overriding the Base Class 281
virtual Modifier 282
new Modifier 286
sealed Modifier 291

base Member 291
Constructors 292
Abstract Classes 293
All Classes Derive from System.Object 299
Ver if yin g the Un der ly ing Type w ith th e is Operator 301
Conversion Using the as Operator 302
Summary 303
7 Interfaces 305
Introducing Interfaces 306
Polymorphism through Interfaces 307
Interface Implementation 312
From the Library of Wow! eBook
ptg
Contentsxvi
Explicit Member Implementation 314
Implicit Member Implementation 315
Explicit versus Implicit Interface Implementation 316
Converting between the Implementing Class and Its
Interfaces 318
Interface Inheritance 318
Multiple Interface Inheritance 321
Extension Methods on Interfaces 322
Implementing Multiple Inheritance via Interfaces 323
Ver si oni ng 326
Interfaces Compared with Classes 328
Summary 329
8 Value Types 331
Structs 332
Initializing structs 336
Using the default Operator 338

Inheritance and Interfaces with Value Types 338
Boxing 339
Enums 346
Type Compatibility between Enums 349
Converting between Enums and Strings 350
Enums as Flags 351
Summary 356
9 Well-Formed Types 357
Overriding object Members 357
Overriding ToString() 358
Overriding GetHashCode() 358
Overriding Equals() 361
Guidelines for Implementing Equality 369
Operator Overloading 369
Comparison Operators (==, !=, <, >, <=, >=) 370
Binary Operators (+, -, *, /, %, &, |, ^, <<, >>) 371
Combining Assignment with Binary Operators (+=, -=, *=, /=, %=, &=…) 373
Conditional Logical Operators (&&, ||) 373
Unary Operators (+, -, !, ~, ++, , true, false) 373
Conversion Operators 375
Guidelines for Conversion Operators 377
Referencing Other Assemblies 377
Changing the Assembly Target 378
Referencing an Assembly 379
Encapsulation of Types 379
From the Library of Wow! eBook
ptg
Contents xvii
Defining Namespaces 382
Namespace Alias Qualifier 384

XML Comments 385
Associating XML Comments with Programming Constructs 386
Generating an XML Documentation File 388
Garbage Collection 390
Weak References 391
Resource Cleanup 393
Finalizers 393
Deterministic Finalization with the using Statement 395
Garbage Collection and Finalization 398
Resource Utilization and Finalization Guidelines 400
Lazy Initialization 400
Summary 403
10 Exception Handling 405
Multiple Exception Types 405
Catching Exceptions 407
General Catch Block 409
Guidelines for Exception Handling 411
Defining Custom Exceptions 414
Summary 419
11 Generics 421
C# without Generics 422
Introducing Generic Types 427
Using a Generic Class 427
Defining a Simple Generic Class 429
Benefits of Generics 430
Type Parameter Naming Guidelines 431
Generic Interfaces and Structs 432
Defining a Constructor and a Finalizer 434
Specifying a Default Value 435
Multiple Type Parameters 436

Arity in Abundance 437
Nested Generic Types 438
Constraints 439
Interface Constraints 442
Base Class Constraints 444
struct/class Constraints 445
Multiple Constraints 446
Constructor Constraints 446
Constraint Inheritance 447
From the Library of Wow! eBook
ptg
Contentsxviii
Generic Methods 453
Type Inferencing 454
Specifying Constraints 455
Covariance and Contravariance 457
Enabling Covariance with the out Type Parameter Modifier in C# 4.0 458
Enabling Contravariance with the in Type Parameter Modifier in C# 4.0 460
Support for Parameter Covariance and Contravariance in Arrays 462
Generic Internals 463
Instantiating Generics Based on Value Types 464
Instantiating Generics Based on Reference Types 465
Summary 467
12 Delegates and Lambda Expressions 469
Introducing Delegates 470
Defining the Scenario 470
Delegate Data Types 472
Delegate Internals 473
Defining a Delegate Type 474
Instantiating a Delegate 475

Anonymous Methods 480
System-Defined Delegates: Func<> 483
Lambda Expressions 486
Statement Lambdas 486
Expression Lambdas 489
Outer Variables 495
Expression Trees 498
Summary 506
13 Events 507
Coding the Observer Pattern with Multicast Delegates 508
Defining Subscriber Methods 508
Defining the Publisher 510
Hooking Up the Publisher and Subscribers 511
Invoking a Delegate 512
Check for null 513
Delegate Operators 514
Sequential Invocation 516
Error Handling 519
Method Returns and Pass-by-Reference 522
Events 523
Why Events? 523
Declaring an Event 525
Coding Conventions 526
From the Library of Wow! eBook
ptg
Contents xix
Generics and Delegates 528
Customizing the Event Implementation 532
Summary 533
14 Collection Interfaces with Standard Query Operators 535

Anonymous Types and Implicitly Typed Local Variables 536
Anonymous Types 537
Implicitly Typed Local Variables (var) 538
More about Anonymous Types and Implicit Local Variables 540
Collection Initializers 543
What Makes a Class a Collection: IEnumerable<T> 546
foreach with Arrays 546
foreach with IEnumerable<T> 547
Do Not Modify Collections during foreach Iteration 552
Standard Query Operators 552
Filtering with Where() 556
Projecting with Select() 557
Counting Elements with Count() 561
Deferred Execution 562
Sorting with OrderBy() and ThenBy() 566
Performing an Inner Join with Join() 572
Grouping Results with GroupBy() 575
Implementing a One-to-Many Relationship with GroupJoin() 577
Calling SelectMany() 580
More Standard Query Operators 582
Summary 586
15 LINQ with Query Expressions 589
Introducing Query Expressions 590
Projection 592
Filtering 598
Sorting 599
The Let Clause 600
Grouping 602
Query Continuation with into 605
Query Expressions as Method Invocations 608

Summary 609
16 Building Custom Collections 611
More Collection Interfaces 612
IList<T> versus IDictionary<TKey, TValue> 614
IComparable<T> 614
ICollection<T> 616
From the Library of Wow! eBook
ptg
Contentsxx
Primary Collection Classes 617
List Collections: List<T> 617
Dictionary Collections: Dictionary<TKey, TValue> 622
Sorted Collections: SortedDictionary<TKey, TValue> and
SortedList<T> 626
Stack Collections: Stack<T> 628
Queue Collections: Queue<T> 629
Linked Lists: LinkedList<T> 629
Providing an Index Operator 630
Returning Null or an Empty Collection 634
Iterators 634
Defining an Iterator 636
Iterator Syntax 636
Yielding Values from an Iterator 637
Iterators and State 639
More Iterator Examples 641
Placing a yield return within a Loop 643
Canceling Further Iteration: yield break 645
Creating Multiple Iterators in a Single Class 648
yield Statement Characteristics 649
Summary 650

17 Reflection, Attributes, and Dynamic Programming 651
Reflection 652
Accessing Metadata Using System.Type 653
Member Invocation 655
Reflection on Generic Types 660
Attributes 663
Custom Attributes 666
Looking for Attributes 667
Initializing an Attribute through a Constructor 668
System.AttributeUsageAttribute 673
Named Parameters 674
Programming with Dynamic Objects 688
Invoking Reflection Using dynamic 689
dynamic Principles and Behaviors 690
Why Dynamic Binding? 694
Static Compilation versus Dynamic Programming 695
Implementing a Custom Dynamic Object 696
Summary 699
From the Library of Wow! eBook
ptg
Contents xxi
18 Multithreading 701
Running and Controlling a Separate Thread 706
ContinueWith() 711
Unhandled Exception Handling on Task 715
Canceling a Task 718
Long-Running Tasks 722
Disposing a Task 723
Executing Iterations in Parallel 724
Parallel Exception Handling with System.AggregateException 728

Canceling a Parallel Loop 729
Running LINQ Queries in Parallel 734
Canceling a PLINQ Query 736
Multithreading before .NET Framework 4 738
Asynchronous Operations with System.Threading.Thread 738
Thread Management 740
Thread Pooling 742
Unhandled Exceptions on the AppDomain 744
Summary 746
19 Synchronization and More Multithreading Patterns 749
Synchronization 750
Synchronization Using Monitor 754
Using the lock Keyword 757
Choosing a lock Object 758
Why to Avoid Locking on this, typeof(type), and string 759
Declaring Fields as volatile 760
Using the System.Threading.Interlocked Class 761
Event Notification with Multiple Threads 763
Synchronization Design Best Practices 764
More Synchronization Types 766
Thread Local Storage 774
Timers 778
Asynchronous Programming Model 783
Calling the APM 784
Calling the APM Using TPL 791
Asynchronous Delegate Invocation 797
Passing Data to and from an Alternate Thread 799
Event-Based Asynchronous Pattern (EAP) 801
Background Worker Pattern 804
Establishing the Pattern 807

Exception Handling 808
From the Library of Wow! eBook
ptg
Contentsxxii
Windows UI Programming 809
Windows Forms 809
Windows Presentation Foundation (WPF) 811
Summary 814
20 Platform Interoperability and Unsafe Code 815
Platform Invoke 816
Declaring External Functions 817
Parameter Data Types 818
Using ref Rather Than Pointers 819
Using StructLayoutAttribute for Sequential Layout 820
Error Handling 821
Using SafeHandle 823
Calling External Functions 826
Simplifying API Calls with Wrappers 828
Function Pointers Map to Delegates 829
Guidelines 829
Pointers and Addresses 830
Unsafe Code 830
Pointer Declaration 832
Assigning a Pointer 834
Dereferencing a Pointer 837
Accessing the Member of a Referent Type 839
Summary 839
21 The Common Language Infrastructure 843
Defining the Common Language Infrastructure (CLI) 844
CLI Implementations 845

C# Compilation to Machine Code 847
Runtime 849
Garbage Collection 849
Garbage Collection on .NET 850
Type Safety 851
Code Access Security 852
Platform Portability 852
Performance 853
Application Domains 854
Assemblies, Manifests, and Modules 855
Common Intermediate Language (CIL) 858
Common Type System (CTS) 858
Common Language Specification (CLS) 859
From the Library of Wow! eBook
ptg
Contents xxiii
Base Class Library (BCL) 860
Metadata 860
Summary 862
A Downloading and Installing the C# Compiler and the CLI
Platform 865
B Full Source Code Listings 869
C Concurrent Classes from System.Collections.Concurrent 895
D C# 2.0 Topics 899
E C# 3.0 Topics 903
F C# 4.0 Topics 905
Index 907
From the Library of Wow! eBook
ptg
This page intentionally left blank

From the Library of Wow! eBook
ptg
xxv
Contents of C# 4.0 Topics
4 Methods and Parameters
Common Namespaces 153
Optional Parameters 182
9 Well-Formed Types
Generics
Lazy Loading With 401
Use of System.Exception 412
Tuple Generic Types 437
11 Generics
Generics
Enabling Covariance 458
Enabling Contravariance 460
Support for Covariance and Contravariance 462
12 Delegates and Lambda Expressions
System-Defined Delegates: Func 483
Parallel LINQ (PLINQ) 559
Programming with Dynamic Objects 688
18 Multithreading 701
Running Threads 706
Unhandled Exception Handling on Task 715
Canceling Tasks 718
From the Library of Wow! eBook
ptg
Contents of C# 4.0 Topicsxxvi
Long-Running Threads 722
Disposing Tasks 723

Executing Iterations in Parallel 724
Parallel Exception Handling with
System.AggregateException 728
Canceling Parallel Loops 729
Running LINQ Queries in Parallel 734
Multithreading, Unhandled Exceptions on AppDomain 744
19 Synchronization and More Multithreading Patterns 749
Monitor Class Synchronization 754
lock Keyword 757
Reset Events 768
ManualResetEvent and Semaphores over AutoReset Event 772
Concurrent Collection Classes 773
Thread Local Storage 774
Calling APMs (Asynchronous Programming
Models) Using TPL (Task Parallel Library) 791
Asynchronous Delegate Invocation 797
From the Library of Wow! eBook
ptg
xxvii
Figures
Figure 2.1: Value Types Contain the Data Directly 55
Figure 2.2: Reference Types Point to the Heap 56
Figure 3.1: Corresponding Placeholder Values 115
Figure 3.2: Calculating the Value of an Unsigned Byte 116
Figure 3.3: Calculating the Value of a Signed Byte 116
Figure 3.4: The Numbers 12 and 7 Represented in Binary 118
Figure 3.5: Collapsed Region in Microsoft Visual Studio .NET 145
Figure 4.1: Exception-Handling Program Flow 190
Figure 5.1: Class Hierarchy 204
Figure 6.1: Refactoring into a Base Class 271

Figure 6.2: Working around Multiple Inheritance Using Aggregation 280
Figure 7.1: Working around Single Inheritances with Aggregation and
Interfaces 326
Figure 8.1: Value Types Contain the Data Directly 332
Figure 8.2: Reference Types Point to the Heap 333
Figure 9.1: Identity 362
Figure 9.2: XML Comments as Tips in Visual Studio IDE 386
Figure 12.1: Delegate Types Object Model 474
Figure 12.2: Anonymous Function terminology 486
Figure 12.3: Object Graph of a Lambda Expression 500
Figure 12.4: Object Graph of Unary and Binary Expressions 501
From the Library of Wow! eBook
ptg
Figuresxxviii
Figure 13.1: Delegate Invocation Sequence Diagram 517
Figure 13.2: Multicast Delegates Chained Together 518
Figure 13.3: Delegate Invocation with Exception Sequence Diagram 520
Figure 14.1: IEnumerator<T> and IEnumerator Interfaces 548
Figure 14.2: IEnumerator<T> and IEnumerator Interfaces 564
Figure 14.3: Venn Diagram of Inventor and Patent Collections 569
Figure 16.1: Generic Collection Interface Hierarchy 613
Figure 16.2: List<> Class Diagrams 618
Figure 16.3: Dictionary Class Diagrams 622
Figure 16.4: SortedList<> and SortedDictionary<> Class
Diagrams 627
Figure 16.5: Stack<T> Class Diagram 629
Figure 16.6: Queue<T> Class Diagram 629
Figure 16.7: LinkedList<T> and LinkedListNode<T> Class
Diagrams 630
Figure 16.8: Sequence Diagram with yield return 640

Figure 17.1: MemberInfo Derived Classes 660
Figure 17.2: BinaryFormatter Does Not Encrypt Data 683
Figure 18.1: Clock Speeds over Time 702
Figure 18.2: CancellationTokenSource and CancellationToken Class
Diagrams 721
Figure 19.1: APM Parameter Distribution 786
Figure 19.2: Delegate Parameter Distribution to BeginInvoke() and
EndInvoke() 800
Figure 20.1: Pointers Contain the Address of the Data 832
Figure 21.1: Compiling C# to Machine Code 848
Figure 21.2: Assemblies with the Modules and Files They Reference 856
From the Library of Wow! eBook
ptg
xxix
Tables
Ta b l e 1.1: C# Keywords 5
Ta b l e 1.2: C# Comment Types 21
Ta b l e 1.3: C# and .NET Versions 26
Ta b l e 2.1: Integer Types 32
Ta b l e 2.2: Floating-Point Types 33
Ta b l e 2.3: decimal Type 34
Ta b l e 2.4: Escape Characters 42
Ta b l e 2.5: string Static Methods 46
Ta b l e 2.6: string Methods 47
Ta b l e 2.7: Common Array Coding Errors 79
Ta b l e 3.1: Control Flow Statements 99
Ta b l e 3.2: Relational and Equality Operators 110
Ta b l e 3.3: Conditional Values for the XOR Operator 113
Ta b l e 3.4: Preprocessor Directives 139
Ta b l e 3.5: Operator Order of Precedence 146

Ta b l e 4.1: Common Namespaces 153
Ta b l e 4.2: Common Exception Types 193
Ta b l e 6.1: Why the New Modifier? 287
Ta b l e 6.2: Members of System.Object 299
Ta b l e 7.1: Comparing Abstract Classes and Interfaces 328
Ta b l e 8.1: Boxing Code in CIL 340
Ta b l e 9.1: Accessibility Modifiers 381
From the Library of Wow! eBook

×