Type.TypeInitializer Property

Definition

取得類型的初始設定式。Gets the initializer for the type.

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

Property Value

ConstructorInfo

物件,包含 Type 的類別建構函式名稱。An object that contains the name of the class constructor for the Type.

Implements

Attributes

Remarks

類別初始化運算式也可以透過 FindMembers 方法,或是透過接受 GetConstructors 做為參數的 GetMemberGetMembersGetConstructorBindingFlags 方法的多載來取得。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.

Applies to

See also