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.

適用於

另請參閱