Type.TypeInitializer Type.TypeInitializer Type.TypeInitializer Type.TypeInitializer Property

定义

获取该类型的初始值设定项。Gets the initializer for the type.

public:
 property System::Reflection::ConstructorInfo ^ TypeInitializer { System::Reflection::ConstructorInfo ^ get(); };
[System.Runtime.InteropServices.ComVisible(true)]
public System.Reflection.ConstructorInfo TypeInitializer { get; }
member this.TypeInitializer : System.Reflection.ConstructorInfo
Public ReadOnly Property TypeInitializer As ConstructorInfo

属性值

包含 Type 的类构造函数的名称的对象。An object that contains the name of the class constructor for the Type.

实现

注解

类初始值设定项,还提供通过FindMembers方法,或通过重载GetMemberGetMembersGetConstructor,并GetConstructors采用的方法BindingFlags作为参数。Class initializers are also available through the FindMembers method, or through overloads of the GetMember, GetMembers, GetConstructor, and GetConstructors methods that take BindingFlags as a parameter.

如果当前Type表示泛型类型或泛型方法定义中的类型参数,此属性返回nullIf the current Type represents a type parameter in the definition of a generic type or generic method, this property returns null.

适用于

另请参阅