Type.TypeInitializer 属性

定义

获取该类型的初始值设定项。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 方法或 GetMemberGetMembersGetConstructorGetConstructors 方法(采用 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.

适用于

另请参阅