Home Page Icon
Home Page
Table of Contents for
C# 3.0 Pocket Reference
Close
C# 3.0 Pocket Reference
by Ben Albahari, Joseph Albahari
C# 3.0 Pocket Reference, 2nd Edition
C# 3.0 Pocket Reference
1. C# 3.0 Pocket Reference
What’s New in C# 3.0
A First C# Program
Compilation
Syntax
Identifiers and Keywords
Avoiding conflicts
Contextual keywords
Literals, Punctuators, and Operators
Comments
Type Basics
Predefined Type Examples
Custom Type Examples
Members of a type
Symmetry of predefined types and custom types
Constructors and instantiation
Instance versus static members
The public keyword
Conversions
Value Types Versus Reference Types
Value types
Reference types
Null
Storage overhead
Predefined Type Taxonomy
Numeric Types
Numeric Literals
Numeric literal type inference
Numeric suffixes
Numeric Conversions
Integral to integral conversions
Floating-point to floating-point conversions
Floating-point to integral conversions
Decimal conversions
Arithmetic Operators
Increment and Decrement Operators
Specialized Integral Operations
Integral division
Integral overflow
Integral arithmetic overflow check operators
Overflow checking for constant expressions
Bitwise operators
8-and 16-Bit Integrals
Special Float and Double Values
double Versus decimal
Real Number Rounding Errors
Boolean Type and Operators
Equality and Comparison Operators
Conditional Operators
Strings and Characters
Char Conversions
String Type
String concatenation
String comparisons
Searching within strings
Manipulating strings
Arrays
Default Element Initialization
Value types versus reference types
Multidimensional Arrays
Rectangular arrays
Jagged arrays
Simplified Array Initialization Expressions
Bounds Checking
Variables and Parameters
The Stack and the Heap
Stack
Heap
Definite Assignment
Default Values
Parameters
Passing arguments by value
The ref modifier
The out modifier
Implications of passing by reference
The params modifier
var: Implicitly Typed Local Variables (C# 3.0)
Expressions and Operators
Primary Expressions
Void Expressions
Assignment Expressions
Operator Precedence and Associativity
Precedence
Left-associative operators
Right-associative operators
Operator Table
Statements
Declaration Statements
Local variables
Expression Statements
Selection Statements
The if statement
The else clause
Changing the flow of execution with braces
The switch statement
Iteration Statements
while and do-while loops
for loops
foreach loops
Jump Statements
The break statement
The continue statement
The goto statement
The return statement
The throw statement
Miscellaneous Statements
Namespaces
The using Directive
Rules Within a Namespace
Name scoping
Name hiding
The global:: qualifier
Repeated namespaces
Aliasing Types and Namespaces
Classes
Fields
Field initialization
Declaring multiple fields together
Methods
Overloading methods
Pass-by-value versus pass-by-reference
Instance Constructors
Overloading constructors
Implicit parameterless constructors
Constructor and field initialization order
Nonpublic constructors
Object Initializers (C# 3.0)
The this Reference
Properties
Read-only and calculated properties
Automatic properties (C# 3.0)
get and set accessibility
Indexers
Implementing an indexer
Constants
Static Constructors
Nondeterminism of static constructors
Static Classes
Finalizers
Partial Types and Methods
Partial methods (C# 3.0)
Inheritance
Polymorphism
Casting
Upcasting
Downcasting
The as operator
The is operator
Virtual Function Members
Abstract Classes and Abstract Members
Hiding Inherited Members
Sealing Functions and Classes
The base Keyword
Constructors and Inheritance
Implicit calling of the parameterless base class constructor
Constructor and field initialization order
Overloading and Resolution
The object Type
Boxing and Unboxing
Copying semantics of boxing and unboxing
Static and Dynamic Type Checking
Object Member Listing
GetType()and typeof
Equals, ReferenceEquals, and GetHashCode
The ToString Method
Structs
Struct Construction Semantics
Access Modifiers
Examples
Accessibility Capping
Restrictions on Access Modifiers
Interfaces
Extending an Interface
Explicit Interface Implementation
Implementing Interface Members Virtually
Reimplementing an Interface in a Subclass
Enums
Enum Conversions
Flags Enumerations
Enum Operators
Nested Types
Generics
Generic Types
Why Generics Exist
Generic Methods
Declaring Generic Parameters
typeof and Generics
The default Generic Value
Generic Constraints
Generics and Covariance
Subclassing Generic Types
Self-Referencing Generic Declarations
Static Data
Generic Collection Initialization
Delegates
Writing Plug-in Methods with Delegates
Multicast Delegates
Instance Versus Static Method Targets
Generic Delegate Types
Delegate Compatibility
Type compatibility
Parameter compatibility
Return type compatibility
Events
Standard Event Pattern
Event Accessors
Event Modifiers
Lambda Expressions (C# 3.0)
Explicitly Specifying Lambda Parameter Types
Generic Lambda Expressions and the Func Delegates
Outer Variables
Anonymous Methods
try Statements and Exceptions
The catch Clause
The finally Block
The using statement
Throwing Exceptions
Rethrowing an exception
Key Properties of System.Exception
Common Exception Types
Enumeration and Iterators
Enumeration
Iterators
Iterator Semantics
Multiple yield statements
yield break
Composing Sequences
Nullable Types
Null Basics
Nullable<T> struct
Implicit and explicit nullable conversions
Boxing and unboxing nullable values
Lifted Operators
Equality operators (== !=)
Relational operators (< <= >= >)
All other operators (+ -* / % & | ^ << >> + ++ --! ~)
Mixing nullable and nonnullable operators
bool?
Null Coalescing Operator
Operator Overloading
Operator Functions
Overloading Equality and Comparison Operators
Custom Implicit and Explicit Conversions
Extension Methods (C# 3.0)
Extension Method Chaining
Ambiguity and Resolution
Namespaces
Extension methods versus instance methods
Extension methods versus extension methods
Anonymous Types (C# 3.0)
LINQ (C# 3.0)
LINQ Fundamentals
A simple query
Projecting
Take and Skip
Element operators
Aggregation operators
Quantifiers
Set operators
Deferred Execution
Standard Query Operators
Chaining Query Operators
Query Syntax
Query syntax versus lambda syntax
The let Keyword
Query Continuations
Multiple Generators
Joining
GroupJoin
Ordering
Grouping
OfType and Cast
Attributes
Attribute Classes
Named and Positional Parameters
Attribute Targets
Specifying Multiple Attributes
Writing Custom Attributes
Retrieving Attributes at Runtime
Unsafe Code and Pointers
Pointer Basics
Unsafe Code
The fixed Statement
The Pointer-to-Member Operator
Arrays
The stackalloc keyword
Fixed-size buffers
void*
Pointers to Unmanaged Code
Preprocessor Directives
Conditional Attributes
Pragma Warning
XML Documentation
Standard XML Documentation Tags
Framework Overview
The Core Framework
System types
Text processing
Collections
Queries
XML
Streams and I/O
Networking
Serialization
Assemblies, reflection, and attributes
Security
Threading
Application domains
Native interoperability
Diagnostics
User Interface Technologies
ASP.NET
Windows Presentation Foundation
Windows Forms
Backend Technologies
ADO.NET
Windows Workflow
COM+ and MSMQ
Distributed System Technologies
Windows Communication Foundation
Remoting and (ASMX) Web Services
CardSpace
Index
About the Authors
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
1. C# 3.0 Pocket Reference
C# 3.0 Pocket Reference
Joseph Albahari
Ben Albahari
Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset