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还可以通过方法或使用BindingFlags作为参数的、 GetMembersGetConstructorGetConstructors方法的GetMember重载来使用类初始值设定项。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.

适用于

另请参阅