This chapter explores the System namespace. System is the top-level namespace of the C# library. It directly contains those classes, structures, interfaces, delegates, and enumerations that are most commonly used by a C# program or that are deemed otherwise integral to the .NET Framework. Thus, System defines the core of the C# library. System also contains many nested namespaces that support specific subsystems, such as System.Net. Several of these subsystems are described later in this book. This chapter is concerned only with the members of System, itself.
In addition to a large number of exception classes, System contains the following classes:
ActivationContext (Added by C# 2.0.) | Activator | AppDomain |
AppDomainManager (Added by C# 2.0.) | AppDomainSetup | ApplicationId (Added by C# 2.0.) |
ApplicationIdentity (Added by C# 2.0.) | Array | AssemblyLoadEventArgs |
Attribute | AttributeUsageAttribute | BitConverter |
Buffer | CharEnumerator | CLSCompliantAttribute |
Console | ConsoleCancelEventArgs (Added by C# 2.0.) | ContextBoundObject |
ContextStaticAttribute | Convert | DBNull |
Delegate | Environment | EventArgs |
Exception | FileStyleUriParser (Added by C# 2.0.) | FlagsAttribute |
FtpStyleUriParser (Added by C# 2.0.) | GC | GenericUriParser (Added by C# 2.0.) |
GopherStyleUriParser (Added by C# 2.0.) | HttpStyleUriParser (Added by C# 2.0.) | LdapStyleUriParser (Added by C# 2.0.) |
LoaderOptimizationAttribute | LocalDataStoreSlot | MarshalByRefObject |
Math | MTAThreadAttribute | MulticastDelegate |
NetPipeStyleUriParser (Added by C# 2.0.) | NetTcpStyleUriParser (Added by C# 2.0.) | NewsStyleUriParser (Added by C# 2.0.) |
NonSerializedAttribute | Nullable (Added by C# 2.0.) | Object |
ObsoleteAttribute | OperatingSystem | ParamArrayAttribute |
Random | ResolveEventArgs | SerializableAttribute |
STAThreadAttribute | String | StringComparer (Added by C# 2.0.) |
ThreadStaticAttribute | TimeZone | Type |
UnhandledExceptionEventArgs | Uri | UriBuilder |
UriParser (Added by C# 2.0.) | UriTypeConverter (Added by C# 2.0.) | ValueType |
Version | WeakReference |
System defines the following structures:
ArgIterator | ArraySegment<T> (Added by C# 2.0.) | Boolean |
Byte | Char | ConsoleKeyInfo (Added by C# 2.0.) |
DateTime | Decimal | Double |
Enum | Guid | Int16 |
Int32 | Int64 | IntPtr |
ModuleHandle (Added by C# 2.0.) | Nullable<T> (Added by C# 2.0.) | RuntimeArgumentHandle |
RuntimeFieldHandle | RuntimeMethodHandle | RuntimeTypeHandle |
SByte | Single | TimeSpan |
TypedReference | UInt16 | UInt32 |
UInt64 | UIntPtr | Void |
System defines the following interfaces:
_AppDomain | IAppDomainSetup | IAsyncResult |
ICloneable | IComparable | IComparable<T> (Added by C# 2.0.) |
IConvertible | ICustomFormatter | IDisposable |
IEquatable<T> (Added by C# 2.0.) | IFormatProvider | IFormattable |
IServiceProvider |
System defines the following delegates:
Action<T> (Added by C# 2.0.) | AppDomainInitializer (Added by C# 2.0.) | AssemblyLoadEventHandler |
AsyncCallback | Comparison<T> (Added by C# 2.0.) | ConsoleCancelEventHandler (Added by C# 2.0.) |
Converter<T, V> (Added by C# 2.0.) | CrossAppDomainDelegate | EventHandler |
EventHandler<T> (Added by C# 2.0.) | Predicate<T> (Added by C# 2.0.) | ResolveEventHandler |
UnhandledExceptionEventHandler |
System defines these enumerations:
ActivationContext.contextForm (Added by C# 2.0.) | AppDomainManagerInitializationOptions (Added by C# 2.0.) | AttributeTargets |
Base64FormattingOptions (Added by C# 2.0.) | ConsoleColor (Added by C# 2.0.) | ConsoleKey (Added by C# 2.0.) |
ConsoleModifiers (Added by C# 2.0.) | ConsoleSpecialKey (Added by C# 2.0.) | DateTimeKind (Added by C# 2.0.) |
DayOfWeek | Environment.SpecialFolder | EnvironmentVariableTarget (Added by C# 2.0.) |
GenericUriParserOptions (Added by C# 2.0.) | LoaderOptimization | MidpointRounding (Added by C# 2.0.) |
PlatformID | StringComparison (Added by C# 2.0.) | StringSplitOptions (Added by C# 2.0.) |
TypeCode | UriComponents (Added by C# 2.0.) | UriFormat (Added by C# 2.0.) |
UriHostNameType | UriKind (Added by C# 2.0.) | UriPartial |
As the preceding tables show, System is quite large. It is not possible to examine all of its constituents in detail in a single chapter. Furthermore, several of System’s members, such as Nullable<T>, Type, Exception, and Attribute, are discussed in Part I or elsewhere in this book. Finally, because System.String, which defines the C# string type, is such a large and important topic, it is covered in Chapter 21 along with formatting. For these reasons, this chapter explores only those members that are most commonly used by C# programmers and that are not fully covered elsewhere.