Kkb Kkb
A Programmer's Introduction to C# 2.0, Third Edition is a critical update to the highly successful second edition. It is written by a member of the original C# language-design team and a C# program manager, so you can be certain this book contains the expertise you're looking for.
Introduction
This third edition covers the new elements of C# 2005 that you'll soon embrace. This comprehensive tutorial explains features like generics, iterators, anonymous types, and partial classes. It is sure to be a key resource for all you C# programmers!
Author Information
Eric Gunnerson is a software design engineer in Microsoft's Visual C++ QA group and a member of the C# design team. In his professional career, he has worked primarily on database products and tools, and is proud that nearly half the companies he has worked for remain in business.
Nick Wienholt is an independent Windows and .NET consultant based in Sydney, Australia. He is the author of Maximizing .NET Performance, one of the top-selling .NET performance books. Since the book's release, it has ranked among Amazon's top 25 .NET titles. Wienholt was awarded the Microsoft MVP award in 2002, 2003, and 2004, and he cofounded the Sydney Deep .NET user group. He also writes technical articles for Australian Developer Journal, ZDNet, Pinnacle Publishing, Developer.com, MSDN Magazine (the Australia and New Zealand Edition), and Microsoft Developer Network. Wienholt is a keen participant in .NET-related newsgroups.
What is in this book
Foreword
Dedication
Acknowledgments
About This Book
The C# Compiler and Other Resources
What Is an Object?
Inheritance
Containment
Polymorphism and Virtual Functions
Encapsulation and Visibility
The Execution Environment
A Simpler Programming Model
Safety and Security
Powerful Tools Support
Deployment, Packaging, and Support
Metadata
Assemblies
Language Interop
Attributes
Hello, Universe
Namespaces and Using
Namespaces and Assemblies
Basic Data Types
Classes, Structs, and Interfaces
Statements
Enums
Delegates and Events
Properties and Indexers
Developing in C#
The Command-Line Compiler
Visual Studio.NET
Other Tools of Note
What’s Wrong with Return Codes?
Trying and Catching
The Exception Hierarchy
Passing Exceptions on to the Caller
Caller Beware
Caller Confuse
Caller Inform
User-Defined Exception Classes
Finally
Efficiency and Overhead
Design Guidelines
A Simple Class
Member Functions
ref and out Parameters
Overloading
The Engineer Class
Simple Inheritance
Arrays of Engineers
Virtual Functions
Abstract Classes
Sealed Classes and Methods
Class Accessibility
Using Internal on Members
internal protected
The Interaction of Class and Member Accessibility
Method Overloading
Method Hiding
Better Conversions
Variable-Length Parameter Lists
Nested Classes
Other Nesting
Creation, Initialization, Destruction
Constructors
Initialization
Destructors
Managing Non-Memory Resources
IDisposable and the Using Statement
IDisposable and Longer-Lived Objects
Static Fields
Static Member Functions
Static Constructors
Constants
Read-Only Fields
A Point Struct
Boxing and Unboxing
Structs and Constructors
Immutable Classes
A Simple Example
Working with Interfaces
The as Operator
Interfaces and Inheritance
Multiple Implementation
Explicit Interface Implementation
Implementation Hiding
Interfaces Based on Interfaces
Interfaces and Structs
A Versioning Example
Designed for Versioning
Designing for Versioning
Selection Statements
If
Switch
Iteration Statements
While
Do
For
Foreach
Jump Statements
Break
Continue
Goto
Return
Other Statements
lock
using
try/catch/finally
checked/unchecked
Definite Assignment
Operator Precedence
Built-In Operators
User-Defined Operators
Numeric Promotions
Arithmetic Operators
Unary Plus (+) over
Unary Minus (-) over
Bitwise Complement (~) over
Addition (+) over
Subtraction (-) over
Multiplication (*) over
Division (/) over
Remainder (%) over
Shift (<< and >>) over
Increment and Decrement (++ and --) over
Relational and Logical Operators
Logical Negation (!) over
Relational Operators over
Logical Operators over
Conditional Operator (?:)
Assignment Operators
Simple Assignment
Compound Assignment
Type Operators
typeof
is
as
Checked and Unchecked Expressions
Numeric Types
Conversions and Member Lookup
Explicit Numeric Conversions
Checked Conversions
Conversions of Classes (Reference Types)
To the Base Class of an Object
To an Interface the Object Implements
To an Interface the Object Might Implement
From One Interface Type to Another
Conversions of Structs (Value Types)
Array Initialization
Multidimensional and Jagged Arrays
Multidimensional Arrays
Jagged Arrays
Arrays of Reference Types
Array Conversions
The System.Array Type
Sorting and Searching
Reverse
Operations
String Encodings and Conversions
Converting Objects to Strings
An Example
String Interning
StringBuilder
Regular Expressions
‘Regular Expression Options
More Complex Parsing
Accessors
Properties and Inheritance
Use of Properties
Side Effects When Setting Values
Static Properties
Property Efficiency
Property Accessibility
Virtual Properties
Indexing with an Integer Index
Indexing with a String Index
Indexing with Multiple Parameters
Enumerators and Foreach
Improving the Enumerator
Disposable Enumerators
GetEnumerator() Returns IEnumerator
GetEnumerator() Returns a Class that Implements IDisposable
GetEnumerator() Returns a Class that Doesn’t Implement IDisposable
A Line Style Enumeration
Enumeration Base Types
Bit Flag Enums
Conversions
The System.Enum Type
Using Attributes
A Few More Details
An Attribute of Your Own
Attribute Usage
Attribute Parameters
Reflecting on Attributes
Using Delegates
Delegates to Instance Members
Multicasting
Delegates as Static Members
Delegates as Static Properties
Add and Remove Functions
Custom Add and Remove
Pre and Post Conversions
Conversions Between Structs
Classes and Pre and Post Conversions
Implicit Conversions Are Safe Conversions
Define the Conversion in the More Complex Type
One Conversion to and from a Hierarchy
Add Conversions Only as Needed
Conversions That Operate in Other Languages
How It Works
Conversion Lookup
Unary Operators
Binary Operators
Restrictions
Guidelines
A Complex Number Class
The Main Function
Returning an Int Status
Command-Line Parameters
Multiple Mains
Preprocessing
Preprocessing Directives
Other Preprocessor Functions
Lexical Details
Identifiers
Literals
Comments
Things All Objects Will Do
ToString
Equals
Hashes and GetHashCode()
Value Type Guidelines
Reference Type Guidelines
Implementing IComparable
Using IComparer
IComparer as a Property
Overloading Relational Operators
Advanced Use of Hashes
Synchronized Collections
Case-Insensitive Collections
IClon]eable
Other Collections
Functions and Interfaces by Framework Class
Data Protection and Synchronization
A Slightly Broken Example
Protection Techniques
Access Reordering and Volatile
Use of Volatile
Threads
Joining
Waiting with WaitHandle
Thread-Local Storage
Asynchronous Calls
Return Values
Waiting for Completion
Classes That Support Asynchronous Calls Directly
Loading Assemblies
Making It Dynamic
Custom Code Generation
Polynomial Evaluation
A Custom C# Class
A Fast Custom C# Class
A CodeDOM Implementation
A Reflection.Emit Implementation
Summary
Using COM Objects
Being Used by COM Objects
Calling Native DLL Functions
Pointers and Declarative Pinning
Structure Layout
Calling a Function with a Structure Parameter
Hooking Up to a Windows Callback
Numeric Formatting
Standard Format Strings
Custom Format Strings
Date and Time Formatting
Custom Object Formatting
Numeric Parsing
Using XML in C#
InputOutput
Binary
Text
XML
Reading and Writing Files
Traversing Directories
Starting Processes
Serialization
Custom Serialization
Reading Web Pages
Accessing Environment Settings
Our Application
Getting Started
The Form Designer
Finding Directory Sizes
Calculating Sizes 414
Displaying the Directory Tree and Sizes
Setting the Directory
Tracking Our Progress
Populating on a Thread
Interrupting a Thread
A Cancel Button
Decorating the TreeView
Expand-o-Matic
Populate on Demand
Sorting the Files
Saving and Restoring
Controlling Serialization
Serialization Performance
Finer Control of Serialization
Comparing Directories
File Manipulation
File and Directory Operations
Delete
Delete Contents
View in Notepad and Launch
Updating the User Interface
A Bit of Refactoring
Cleaning Up for the Parents
Keyboard Accelerators
Most Recently Used List
Tooltips
Increased Accuracy
Switching to Use Cluster Size
C# Style
Naming
Encapsulation
Guidelines for the Library Author
CLS Compliance
Class Naming
Unsafe Context
XML Documentation
Compiler Support Tags
XML Documentation Tags
XML Include Files
Garbage Collection in the .NET Runtime
Allocation
Mark and Compact
Generations
Finalization
Controlling GC Behavior
Deeper Reflection
Listing All the Types in an Assembly
Finding Members
Invoking Functions
Optimizations
Conditional Methods
Debug and Trace Classes
Asserts
Debug and Trace Output
Using Switches to Control Debug and Trace
BooleanSwitch
TraceSwitch
User-Defined Switch
Simple Usage
Response Files
Default Response File
Command-Line Options
Differences Between C# and C/C++
A Managed Environment
.NET Objects
C# Statements
Versioning
Code Organization
Missing C# Features
Differences Between C# and Java
Data Types
Extending the Type System
Classes
Interfaces
Differences Between C# and Visual Basic 6
Code Appearance
Data Types and Variables
Operators and Expressions
Classes, Types, Functions, and Interfaces
Control and Program Flow
Select Case
On Error
Missing Statements
Other .NET Languages
MSDN
GotDotNet
Csharpindex
C-Sharp Corner
DotNet Books
C# Futures
Note:
Mindcracker Network accepts no liability for providing the customer with the hard copy of the book purchased. Mindcracker is not responsible for any dispute relating to the above. All eBooks listed in this section are in "PDF" Format. Contact [email protected] for further assistant.
Unlock unlimited ebook downloads. Share it on your social profile.