only for RuBoard - do not distribute or recompile Previous Section Next Section

C# in a Nutshell

Preface
   Audience
   Contents of This Book
   Assumptions This Book Makes
   Conventions Used in This Book
   Related Books
   C# Resources Online
   How to Contact Us
   How the Quick Reference Is Generated
   Acknowledgments

I: Programming with C#

1. Introducing C# and the .NET Framework
   1.1 The C# Language
   1.2 The .NET Framework
   1.3 ECMA Standardization

2. C# Language Basics
   2.1 A First C# Program
   2.2 Identifiers and Keywords
   2.3 Type Basics
   2.4 Value Types and Reference Types
   2.5 Predefined Types
   2.6 Arrays
   2.7 Variables and Parameters
   2.8 Expressions and Operators
   2.9 Statements
   2.10 Namespaces

3. Creating Types in C#
   3.1 Classes
   3.2 Inheritance
   3.3 Access Modifiers
   3.4 Structs
   3.5 Interfaces
   3.6 Enums

4. Advanced C# Features
   4.1 Delegates
   4.2 Delegates Versus Function Pointers
   4.3 Delegates Versus Interfaces
   4.4 Events
   4.5 Operator Overloading
   4.6 Try Statements and Exceptions
   4.7 Attributes
   4.8 Unsafe Code and Pointers
   4.9 Preprocessor Directives
   4.10 XML Documentation

II: Programming with the .NET Framework

5. Framework Class Library Overview
   5.1 Core Types
   5.2 Text
   5.3 Collections
   5.4 Streams and I/O
   5.5 Networking
   5.6 Threading
   5.7 Security
   5.8 Reflection and Metadata
   5.9 Assemblies
   5.10 Serialization
   5.11 Remoting
   5.12 Web Services
   5.13 Data Access
   5.14 XML
   5.15 Graphics
   5.16 Rich Client Applications
   5.17 Web-Based Applications
   5.18 Globalization
   5.19 Configuration
   5.20 Advanced Component Services
   5.21 Diagnostics and Debugging
   5.22 Interoperating with Unmanaged Code
   5.23 Compiler and Tool Support
   5.24 Runtime Facilities
   5.25 Native OS Facilities
   5.26 Undocumented Types

6. String Handling
   6.1 String Class
   6.2 StringBuilder Class
   6.3 Regular Expression Support
   6.4 Regular Expression Basics
   6.5 Procedural- and Expression-Based Patterns
   6.6 Cookbook Regular Expressions

7. Collections
   7.1 Iterating Over Collections
   7.2 Standard Collection Interfaces
   7.3 Predefined Collection Classes
   7.4 Ordering Instances
   7.5 Generating Hash Code

8. XML I/O
   8.1 Accessing XML Documents
   8.2 Parsing an XML Stream
   8.3 Selecting Nodes Using XPath
   8.4 Transforming a Document Using XSLT

9. Networking
   9.1 Network Programming Models
   9.2 Generic Request/Response Architecture
   9.3 HTTP-Specific Support
   9.4 WebClient
   9.5 Adding New Protocol Handlers
   9.6 Using TCP, UDP, and Sockets
   9.7 Using DNS

10. Streams and I/O
   10.1 Streams and Backing Stores
   10.2 Encapsulating Raw Streams
   10.3 Directories and Files
   10.4 Isolated Storage

11. Serialization
   11.1 What Is Serialization?
   11.2 Serialization Support in the Framework
   11.3 Explicit Serialization
   11.4 Implicit Serialization
   11.5 [Serializable]
   11.6 [NonSerialized]
   11.7 IDeserializationCallback
   11.8 ISerializable
   11.9 [Serializable] and ISerializable

12. Assemblies
   12.1 Elements of an Assembly
   12.2 Assemblies and Modules
   12.3 Scoping Types and Type References
   12.4 Naming and Signing Assemblies
   12.5 Resolving and Loading Assemblies
   12.6 Deployment
   12.7 Security Permissions

13. Reflection
   13.1 Type Hierarchy
   13.2 Types, Members, and Nested Types
   13.3 Retrieving the Type for an Instance
   13.4 Retrieving a Type Directly
   13.5 Reflecting Over a Type Hierarchy
   13.6 Late Binding
   13.7 Advanced Uses of Reflection
   13.8 Creating New Types at Runtime

14. Custom Attributes
   14.1 Language Support
   14.2 Compiler Support
   14.3 Runtime Support
   14.4 Predefined Attributes
   14.5 Defining a New Custom Attribute
   14.6 Retrieving a Custom Attribute at Runtime

15. Memory Management
   15.1 The Garbage Collector
   15.2 Optimization Techniques
   15.3 Finalizers
   15.4 Dispose and Close Methods

16. Threading
   16.1 Thread Synchronization
   16.2 Common Thread Types
   16.3 Asynchronous Delegates

17. Integrating with Native DLLs
   17.1 Calling Into DLLs
   17.2 Marshaling Common Types
   17.3 Marshaling Classes and Structs
   17.4 In and Out Marshaling
   17.5 Callbacks from Unmanaged Code
   17.6 Simulating a C Union
   17.7 Mapping a Struct to a Binary Format
   17.8 Predefined Interop Support Attributes

18. Integrating with COM Components
   18.1 Binding COM and C# Objects
   18.2 Exposing COM Objects to C#
   18.3 Exposing C# Objects to COM
   18.4 COM Mapping in C#
   18.5 Common COM Interop Support Attributes
   18.6 COM+ Support

19. Diagnostics
   19.1 Logging and Assertion Facilities
   19.2 Conditional Compilation
   19.3 Debugger Integration
   19.4 Processes, Threads, and Stacks
   19.5 Event Logs
   19.6 Performance Counters

III: Language and Tools Reference

20. C# Language Reference

21. XML Documentation Tag Reference

22. C# Naming and Coding Conventions
   22.1 Case
   22.2 Mechanics
   22.3 Word Choice
   22.4 Namespaces

23. C# Development Tools
   ADepends.exe
   Al.exe
   Cordbg.exe
   Csc.exe
   DbgCLR.exe
   GacUtil.exe
   ILasm.exe
   ILDasm.exe
   InstallUtil.exe
   Ngen.exe
   Nmake.exe
   PEVerify.exe
   RegAsm.exe
   RegSvcs.exe
   Sn.exe
   SoapSuds.exe
   TlbExp.exe
   TlbImp.exe
   Wsdl.exe
   WinCV.exe
   Xsd.exe

IV: API Quick Reference

24. How to Use This Quick Reference
   24.1 Finding a Quick-Reference Entry
   24.2 Reading a Quick-Reference Entry

25. Microsoft.Win32
   PowerModeChangedEventArgs
   PowerModeChangedEventHandler
   PowerModes
   Registry
   RegistryHive
   RegistryKey
   SessionEndedEventArgs
   SessionEndedEventHandler
   SessionEndingEventArgs
   SessionEndingEventHandler
   SessionEndReasons
   SystemEvents
   TimerElapsedEventArgs
   TimerElapsedEventHandler
   UserPreferenceCategory
   UserPreferenceChangedEventArgs
   UserPreferenceChangedEventHandler
   UserPreferenceChangingEventArgs
   UserPreferenceChangingEventHandler

26. System
   Activator
   AppDomain
   AppDomainSetup
   AppDomainUnloadedException
   ApplicationException
   ArgIterator
   ArgumentException class
   ArgumentNullException
   ArgumentOutOfRangeException
   ArithmeticException
   Array
   ArrayTypeMismatchException
   AssemblyLoadEventArgs
   AssemblyLoadEventHandler
   AsyncCallback
   Attribute
   AttributeTargets
   AttributeUsageAttribute
   BadImageFormatException
   BitConverter
   Boolean
   Buffer
   Byte
   CannotUnloadAppDomainException
   Char
   CharEnumerator
   CLSCompliantAttribute
   Console
   ContextBoundObject
   ContextMarshalException
   ContextStaticAttribute
   Convert
   CrossAppDomainDelegate
   DateTime
   DayOfWeek
   DBNull
   Decimal
   Delegate
   DivideByZeroException
   DllNotFoundException
   Double
   DuplicateWaitObjectException
   EntryPointNotFoundException
   Enum
   Environment
   Environment.SpecialFolder
   EventArgs
   EventHandler
   Exception
   ExecutionEngineException
   FieldAccessException
   FlagsAttribute
   FormatException
   GC
   Guid
   IAsyncResult
   ICloneable
   IComparable
   IConvertible
   ICustomFormatter
   IDisposable
   IFormatProvider
   IFormattable
   IndexOutOfRangeException
   Int16
   Int32
   Int64
   IntPtr
   InvalidCastException
   InvalidOperationException
   InvalidProgramException
   IServiceProvider
   LoaderOptimization
   LoaderOptimizationAttribute
   LocalDataStoreSlot
   MarshalByRefObject
   Math
   MemberAccessException
   MethodAccessException
   MissingFieldException
   MissingMemberException
   MissingMethodException
   MTAThreadAttribute
   MulticastDelegate
   MulticastNotSupportedException
   NonSerializedAttribute
   NotFiniteNumberException
   NotImplementedException
   NotSupportedException
   NullReferenceException
   Object
   ObjectDisposedException
   ObsoleteAttribute
   OperatingSystem
   OutOfMemoryException
   OverflowException
   ParamArrayAttribute
   PlatformID
   PlatformNotSupportedException
   Random
   RankException
   ResolveEventArgs
   ResolveEventHandler
   RuntimeTypeHandle
   SByte
   SerializableAttribute
   Single
   StackOverflowException
   STAThreadAttribute
   String
   SystemException
   ThreadStaticAttribute
   TimeSpan
   TimeZone
   Type
   TypeCode
   TypeInitializationException
   TypeLoadException
   TypeUnloadedException
   UInt16
   UInt32
   UInt64
   UIntPtr
   UnauthorizedAccessException
   UnhandledExceptionEventArgs
   UnhandledExceptionEventHandler
   Uri
   UriBuilder
   UriFormatException
   UriHostNameType
   UriPartial
   ValueType
   Version
   Void
   WeakReference

27. System.Collections
   ArrayList
   BitArray
   CaseInsensitiveComparer
   CaseInsensitiveHashCodeProvider
   CollectionBase
   Comparer
   DictionaryBase
   DictionaryEntry
   Hashtable
   ICollection
   IComparer
   IDictionary
   IDictionaryEnumerator
   IEnumerable
   IEnumerator
   IHashCodeProvider
   IList
   Queue
   ReadOnlyCollectionBase
   SortedList
   Stack

28. System.Collections.Specialized
   BitVector32
   BitVector32.Section
   CollectionsUtil
   HybridDictionary
   ListDictionary
   NameObjectCollectionBase
   NameObjectCollectionBase.KeysCollection
   NameValueCollection
   StringCollection
   StringDictionary
   StringEnumerator

29. System.Diagnostics
   BooleanSwitch
   ConditionalAttribute
   CounterCreationData
   CounterCreationDataCollection
   CounterSample
   CounterSampleCalculator
   Debug
   DebuggableAttribute
   Debugger
   DebuggerHiddenAttribute
   DebuggerStepThroughAttribute
   DefaultTraceListener
   EntryWrittenEventArgs
   EntryWrittenEventHandler
   EventLog
   EventLogEntry
   EventLogEntryCollection
   EventLogEntryType
   EventLogInstaller
   EventLogPermission
   EventLogPermissionAccess
   EventLogPermissionAttribute
   EventLogPermissionEntry
   EventLogPermissionEntryCollection
   EventLogTraceListener
   FileVersionInfo
   InstanceData
   InstanceDataCollection
   InstanceDataCollectionCollection
   MonitoringDescriptionAttribute
   PerformanceCounter
   PerformanceCounterCategory
   PerformanceCounterInstaller
   PerformanceCounterPermission
   PerformanceCounterPermissionAccess
   PerformanceCounterPermissionAttribute
   PerformanceCounterPermissionEntry
   PerformanceCounterPermissionEntryCollection
   PerformanceCounterType
   Process
   ProcessModule
   ProcessModuleCollection
   ProcessPriorityClass
   ProcessStartInfo
   ProcessThread
   ProcessThreadCollection
   ProcessWindowStyle
   StackFrame
   StackTrace
   Switch
   TextWriterTraceListener
   ThreadPriorityLevel
   ThreadState
   ThreadWaitReason
   Trace
   TraceLevel
   TraceListener
   TraceListenerCollection
   TraceSwitch

30. System.Globalization
   Calendar
   CalendarWeekRule
   CompareInfo
   CompareOptions
   CultureInfo
   CultureTypes
   DateTimeFormatInfo
   DateTimeStyles
   DaylightTime
   GregorianCalendar
   GregorianCalendarTypes
   HebrewCalendar
   HijriCalendar
   JapaneseCalendar
   JulianCalendar
   KoreanCalendar
   NumberFormatInfo
   NumberStyles
   RegionInfo
   SortKey
   StringInfo
   TaiwanCalendar
   TextElementEnumerator
   TextInfo
   ThaiBuddhistCalendar
   UnicodeCategory

31. System.IO
   BinaryReader
   BinaryWriter
   BufferedStream
   Directory
   DirectoryInfo
   DirectoryNotFoundException
   EndOfStreamException
   ErrorEventArgs
   ErrorEventHandler
   File
   FileAccess
   FileAttributes
   FileInfo
   FileLoadException
   FileMode
   FileNotFoundException
   FileShare
   FileStream
   FileSystemEventArgs
   FileSystemEventHandler
   FileSystemInfo
   FileSystemWatcher
   InternalBufferOverflowException
   IODescriptionAttribute
   IOException
   MemoryStream
   NotifyFilters
   Path
   PathTooLongException
   RenamedEventArgs
   RenamedEventHandler
   SeekOrigin
   Stream
   StreamReader
   StreamWriter
   StringReader
   StringWriter
   TextReader
   TextWriter
   WaitForChangedResult
   WatcherChangeTypes

32. System.IO.IsolatedStorage
   INormalizeForIsolatedStorage
   IsolatedStorage
   IsolatedStorageException
   IsolatedStorageFile
   IsolatedStorageFileStream
   IsolatedStorageScope

33. System.Net
   AuthenticationManager
   Authorization
   Cookie
   CookieCollection
   CookieContainer
   CookieException
   CredentialCache
   Dns
   DnsPermission
   DnsPermissionAttribute
   EndPoint
   EndpointPermission
   FileWebRequest
   FileWebResponse
   GlobalProxySelection
   HttpContinueDelegate
   HttpStatusCode
   HttpVersion
   HttpWebRequest
   HttpWebResponse
   IAuthenticationModule
   ICertificatePolicy
   ICredentials
   IPAddress
   IPEndPoint
   IPHostEntry
   IWebProxy
   IWebRequestCreate
   NetworkAccess
   NetworkCredential
   ProtocolViolationException
   ServicePoint
   ServicePointManager
   SocketAddress
   SocketPermission
   SocketPermissionAttribute
   TransportType
   WebClient
   WebException
   WebExceptionStatus
   WebHeaderCollection
   WebPermission
   WebPermissionAttribute
   WebProxy
   WebRequest
   WebResponse

34. System.Net.Sockets
   AddressFamily
   LingerOption
   MulticastOption
   NetworkStream
   ProtocolFamily
   ProtocolType
   SelectMode
   Socket
   SocketException
   SocketFlags
   SocketOptionLevel
   SocketOptionName
   SocketShutdown
   SocketType
   TcpClient
   TcpListener
   UdpClient

35. System.Reflection
   AmbiguousMatchException
   Assembly
   AssemblyAlgorithmIdAttribute
   AssemblyCompanyAttribute
   AssemblyConfigurationAttribute
   AssemblyCopyrightAttribute
   AssemblyCultureAttribute
   AssemblyDefaultAliasAttribute
   AssemblyDelaySignAttribute
   AssemblyDescriptionAttribute
   AssemblyFileVersionAttribute
   AssemblyFlagsAttribute
   AssemblyInformationalVersionAttribute
   AssemblyKeyFileAttribute
   AssemblyKeyNameAttribute
   AssemblyName
   AssemblyNameFlags
   AssemblyNameProxy
   AssemblyProductAttribute
   AssemblyTitleAttribute
   AssemblyTrademarkAttribute
   AssemblyVersionAttribute
   Binder
   BindingFlags
   CallingConventions
   ConstructorInfo
   CustomAttributeFormatException
   DefaultMemberAttribute
   EventAttributes
   EventInfo
   FieldAttributes
   FieldInfo
   ICustomAttributeProvider
   InterfaceMapping
   InvalidFilterCriteriaException
   IReflect
   ManifestResourceInfo
   MemberFilter
   MemberInfo
   MemberTypes
   MethodAttributes
   MethodBase
   MethodImplAttributes
   MethodInfo
   Missing
   Module
   ModuleResolveEventHandler
   ParameterAttributes
   ParameterInfo
   ParameterModifier
   Pointer
   PropertyAttributes
   PropertyInfo
   ReflectionTypeLoadException
   ResourceAttributes
   ResourceLocation
   StrongNameKeyPair
   TargetException
   TargetInvocationException
   TargetParameterCountException
   TypeAttributes
   TypeDelegator
   TypeFilter

36. System.Reflection.Emit
   AssemblyBuilder
   AssemblyBuilderAccess
   ConstructorBuilder
   CustomAttributeBuilder
   EnumBuilder
   EventBuilder
   EventToken
   FieldBuilder
   FieldToken
   FlowControl
   ILGenerator
   Label
   LocalBuilder
   MethodBuilder
   MethodRental
   MethodToken
   ModuleBuilder
   OpCode
   OpCodes
   OpCodeType
   OperandType
   PackingSize
   ParameterBuilder
   ParameterToken
   PEFileKinds
   PropertyBuilder
   PropertyToken
   SignatureHelper
   SignatureToken
   StackBehaviour
   StringToken
   TypeBuilder
   TypeToken
   UnmanagedMarshal

37. System.Runtime.InteropServices
   ArrayWithOffset
   AssemblyRegistrationFlags
   CallingConvention
   CharSet
   ClassInterfaceAttribute
   ClassInterfaceType
   CoClassAttribute
   ComAliasNameAttribute
   ComConversionLossAttribute
   COMException
   ComImportAttribute
   ComInterfaceType
   ComMemberType
   ComRegisterFunctionAttribute
   ComSourceInterfacesAttribute
   ComUnregisterFunctionAttribute
   ComVisibleAttribute
   CurrencyWrapper
   DispatchWrapper
   DispIdAttribute
   DllImportAttribute
   ErrorWrapper
   ExtensibleClassFactory
   ExternalException
   FieldOffsetAttribute
   GCHandle
   GCHandleType
   GuidAttribute
   HandleRef
   IDispatchImplAttribute
   IDispatchImplType
   InAttribute
   InterfaceTypeAttribute
   InvalidComObjectException
   InvalidOleVariantTypeException
   IRegistrationServices
   LayoutKind
   LCIDConversionAttribute
   Marshal
   MarshalAsAttribute
   MarshalDirectiveException
   ObjectCreationDelegate
   OptionalAttribute
   OutAttribute
   PreserveSigAttribute
   ProgIdAttribute
   RegistrationServices
   RuntimeEnvironment
   SafeArrayRankMismatchException
   SafeArrayTypeMismatchException
   SEHException
   StructLayoutAttribute
   UnknownWrapper
   UnmanagedType
   VarEnum
   IExpando

38. System.Runtime.Serialization
   Formatter
   FormatterConverter
   FormatterServices
   IDeserializationCallback
   IFormatter
   IFormatterConverter
   IObjectReference
   ISerializable
   ISerializationSurrogate
   ISurrogateSelector
   ObjectIDGenerator
   ObjectManager
   SerializationBinder
   SerializationEntry
   SerializationException
   SerializationInfo
   SerializationInfoEnumerator
   StreamingContext
   StreamingContextStates
   SurrogateSelector

39. System.Runtime.Serialization.Formatters
   BinaryFormatter
   FormatterAssemblyStyle
   FormatterTypeStyle
   IFieldInfo
   ISoapMessage
   ServerFault
   SoapFault
   SoapFormatter
   SoapMessage

40. System.Text
   ASCIIEncoding
   Decoder
   Encoder
   Encoding
   StringBuilder
   UnicodeEncoding
   UTF7Encoding
   UTF8Encoding

41. System.Text.RegularExpressions
   Capture
   CaptureCollection
   Group
   GroupCollection
   Match
   MatchCollection
   MatchEvaluator
   Regex
   RegexCompilationInfo
   RegexOptions

42. System.Threading
   ApartmentState
   AutoResetEvent
   Interlocked
   IOCompletionCallback
   LockCookie
   ManualResetEvent
   Monitor
   Mutex
   NativeOverlapped
   Overlapped
   ReaderWriterLock
   RegisteredWaitHandle
   SynchronizationLockException
   Thread
   ThreadAbortException
   ThreadExceptionEventArgs
   ThreadExceptionEventHandler
   ThreadInterruptedException
   ThreadPool
   ThreadPriority
   ThreadStart
   ThreadState
   ThreadStateException
   Timeout
   Timer
   TimerCallback
   WaitCallback
   WaitHandle
   WaitOrTimerCallback

43. System.Timers
   ElapsedEventArgs
   ElapsedEventHandler
   Timer
   TimersDescriptionAttribute

44. System.Xml
   EntityHandling
   Formatting
   IHasXmlNode
   IXmlLineInfo
   NameTable
   ReadState
   ValidationType
   WhitespaceHandling
   WriteState
   XmlAttribute
   XmlAttributeCollection
   XmlCDataSection
   XmlCharacterData
   XmlComment
   XmlConvert
   XmlDataDocument
   XmlDeclaration
   XmlDocument
   XmlDocumentFragment
   XmlDocumentType
   XmlElement
   XmlEntity
   XmlEntityReference
   XmlException
   XmlImplementation
   XmlLinkedNode
   XmlNamedNodeMap
   XmlNamespaceManager
   XmlNameTable
   XmlNode
   XmlNodeChangedAction
   XmlNodeChangedEventArgs
   XmlNodeChangedEventHandler
   XmlNodeList
   XmlNodeOrder
   XmlNodeReader
   XmlNodeType
   XmlNotation
   XmlParserContext
   XmlProcessingInstruction
   XmlQualifiedName
   XmlReader
   XmlResolver
   XmlSignificantWhitespace
   XmlSpace
   XmlText
   XmlTextReader
   XmlTextWriter
   XmlTokenizedType
   XmlUrlResolver
   XmlValidatingReader
   XmlWhitespace
   XmlWriter

45. System.Xml.XPath
   IXPathNavigable
   XmlCaseOrder
   XmlDataType
   XmlSortOrder
   XPathDocument
   XPathException
   XPathExpression
   XPathNamespaceScope
   XPathNavigator
   XPathNodeIterator
   XPathNodeType
   XPathResultType

46. System.Xml.Xsl
   IXsltContextFunction
   IXsltContextVariable
   XsltArgumentList
   XsltCompileException
   XsltContext
   XsltException
   XslTransform

V: Appendixes

A. Regular Expressions

B. Format Specifiers
   B.1 Picture Format Specifiers
   B.2 DateTime Format Specifiers

C. Data Marshaling

D. C# Keywords

E. Namespaces and Assemblies

Type, Method, Property Event, and Field Index
   A
   B
   C
   D
   E
   F
   G
   H
   I
   J
   K
   L
   m
   N
   O
   P
   Q
   R
   S
   T
   U
   V
   W
   X
   Y
   Z

Colophon

only for RuBoard - do not distribute or recompile Previous Section Next Section