Content in mscorlib.dll

zhaozj2021-02-16  150

Use the Model View in Together vs.NET to view the contents of the References. The first reference is Mscorlib.dll, and after opening its default (DIAGRAM), there are two parts: Microsoft and SYSTEM. Here first study the system namespace. Open system class diagram Abbrevite:

Haha, all things in all system have strict appearance in front of you. Look at the first look at left to right:

First, Iclonable and _Appdomain interface

There are seven classes of iiconable implementation, namely:

CharNumerator: Supports loop access String and reads each of its characters.

Array: Provides methods for creating, operation, searching, and sort arrays, thus being used as base classes of all arrays in the public language runtime.

MultcastdeLegate: Represents multiple broadcast delegates; ie, it can have a delegation of multiple elements in the list of calls. MulticastDelegate has a delegate list with links, which is called a call list, which contains one or more elements. When the multiplex commission is called, these delegates will be called in order in the order in the invocation list. If an error occurs during the execution of the list, an exception is thrown.

Delegate: Delegation, delegate is a data structure that references a static method or a reference class instance and an instance method of such a class.

Version: Represents the version number of the public language runtime assembly.

OperatingSystem: Indicates information about the operating system, such as version and platform identifier.

String: Represents text, a series of Unicode characters.

2.appdomain implements the _appdomain interface, which represents the application domain, which is an independent environment in which an application is implemented.

Second, MARSHALBYREFOBJECT allows access to objects across application domains in applications that support remote processing. He has children: appdomain and contextBoundObject: Define all the base classes of all context binding classes.

Third, the Iappdomainsetup interface, the corresponding implementation class is the appdomainsetup represents the assembly binding information that can be added to the instance of AppDomain.

Fourth, the next three major interfaces: IComparable, Icoverable, IFORMATTABLE, they are mainly prepared for defining data types.

1. Realize the following data type (they are comparable):

Version, Datetime, String, Timespan, Char, Boolean, Double, Single, Int32, Int64, Byte, Int16, Sbyte, Uint64, Decimal, Uint32, Uint16, Guid, ENUM

TimeSpan represents a time interval.

GUID represents the global unique identifier (GUID).

2. Implement the following data types (they are convertible):

Datetime, String, Char, Boolean, Double, Single, Int32, DBNULL, INT64, BYTE, INT16, SBYTE, UINT64, DECIMAL, UINT32, UINT16, ENUM

DBNULL is used to indicate that there is no known value (usually in the database application).

3. Implementing the iformatTable interface, such as data type (they are all formatted):

DateTime, Double, Single, INT32, INT64, BYTE, INT16, SBYTE, UINT64, DECIMAL, UINT32, UINT16, GUID, ENUM seem to be only compared, and can be formatted.

Here we found that in addition to the most basic data type in SYSTEM, there is also a data type such as Timespan, GUID, DBNULL and other programming tools. Speaking of data types, there should be data types such as lists, packages, and collections. In addition to Array Represents an array directly in System, other namespace collections should be named in its next level.

5. Next is some special types: uintptr, type, intptr, void

UINTPTR and INTPTR are used to represent a platform specific type of the pointer or handle.

Type representation type declaration: class type, interface type, array type, value type, and enumeration type.

VOID indicates a method of non-return value, that is, a method of returning a VOID return type. He is used in System.Reflection, and he doesn't have a member, so it cannot create an instance of this structure.

6. Attribute is an important class that represents the base class of custom properties, there are many ready-made subclasses in the System space.

Seven, Exception is another important class, and he indicates an error in the application runtime. In System, you have direct inherited ExcePton with SystemException and ApplicationException. There are also a large number of subclasses to indicate that there is an error in the system of SYSTEM.

Eight, there are some relatively independent classes:

Environment provides information about the current environment and platforms and how they operate them.

LocalDataStoreSlot package memory slots to store local data.

LocalDataStoremgr This class seems to have an explanation in MSDN. It should be used with LocalDataStoreSlot to manage the memory.

Timezone represents time zone.

EVENARGS is a base class for classes that contain event data.

Math provides constants and static methods for triangular functions, logarithmic functions, and other universal mathematics functions.

IServerProvider defines a mechanism for retrieving service objects, and the service object is an object that provides custom support for other objects.

IFORMATPROVIDER provides a mechanism for retrieving objects that control formatted.

ICustomProvider defines a method that supports custom (user-defined) format settings for object values.

IASYNCPROVIDER indicates the state of asynchronous operation.

IDisposable defines a method of releasing allocated unmanaged resources.

GC Control System Garbage Equipment (a service that is automatically recycled without memory).

Console represents the standard input stream, output flow, and error flow of the console application.

A array of buffers operating the primitive type.

BitConverter converts the underlying data type with byte arrays.

Argiterator represents a list of bell-length parameters; that is, the parameters of the function of variable number of parameters.

Activator contains specific methods to create object types locally or from remote objects, or get references to existing remote objects.

Object supports all classes in the .NET Framework class hierarchy and provides low-level services for derived classes. This is the final base class of all classes in .NET Framework; it is the root of type hierarchy.

Random represents a pseudo random number generator, an apparatus capable of generating a digital sequence that meets some random statistics requirements.

WeakReference represents "weak reference", that is, while the reference object is still allowed to be involved in garbage collection.

The TypedReference description includes both a managed pointer to a certain location, also contains objects of the type of runtime representation of the type of time that may be stored.

Nine, in addition to these the most basic classes, there are many subspaces in System: Configration, Resources, Diagostics, Collectes, Threading, Runtime, Text, Globalization, Ruth, Security, IO These content is relatively large, and need to be studied separately.

Ten, from these content, in fact, the content in System is very rich, some of the most basic functions and implementations are implemented here, some use a class or structure or interface, some simply use a child name space. Express. Many of Microsoft's .NET is embodied or implemented in mscorlib.dll. If some features are implemented later, you should first come here. Net has a ready-made implementation, otherwise it is not empty. Not necessarily effective. Learning .NET, is to have all the things that he has achieved in things, which is convenient for self-employment, while learning from his implementation method, give self have more ideas.

The above learning is just a little fur, you can also study the design model used in it. The next time I have a good one after a good one in the Jiu Li column.

转载请注明原文地址:https://www.9cbs.com/read-8786.html

New Post(0)