TypeDescriptionProvider.GetTypeDescriptor 方法

定義

取得特定型別或物件的自訂型別描述項。

多載

GetTypeDescriptor(Object)

取得特定物件的自訂型別描述項。

GetTypeDescriptor(Type)

取得特定型別的自訂型別描述項。

GetTypeDescriptor(Type, Object)

取得特定型別和物件的自訂型別描述項。

GetTypeDescriptor(Object)

來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs

取得特定物件的自訂型別描述項。

public:
 System::ComponentModel::ICustomTypeDescriptor ^ GetTypeDescriptor(System::Object ^ instance);
public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor (object instance);
public System.ComponentModel.ICustomTypeDescriptor? GetTypeDescriptor (object instance);
member this.GetTypeDescriptor : obj -> System.ComponentModel.ICustomTypeDescriptor
Public Function GetTypeDescriptor (instance As Object) As ICustomTypeDescriptor

參數

instance
Object

型別的執行個體。 如果未傳遞執行個體至 TypeDescriptor,可以為 null

傳回

ICustomTypeDescriptor,可以提供型別的中繼資料。

例外狀況

instancenull

另請參閱

適用於

GetTypeDescriptor(Type)

來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs

取得特定型別的自訂型別描述項。

public:
 System::ComponentModel::ICustomTypeDescriptor ^ GetTypeDescriptor(Type ^ objectType);
public System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor (Type objectType);
public System.ComponentModel.ICustomTypeDescriptor? GetTypeDescriptor (Type objectType);
member this.GetTypeDescriptor : Type -> System.ComponentModel.ICustomTypeDescriptor
Public Function GetTypeDescriptor (objectType As Type) As ICustomTypeDescriptor

參數

objectType
Type

要為其擷取型別描述項之物件的型別。

傳回

ICustomTypeDescriptor,可以提供型別的中繼資料。

另請參閱

適用於

GetTypeDescriptor(Type, Object)

來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs
來源:
TypeDescriptionProvider.cs

取得特定型別和物件的自訂型別描述項。

public:
 virtual System::ComponentModel::ICustomTypeDescriptor ^ GetTypeDescriptor(Type ^ objectType, System::Object ^ instance);
public virtual System.ComponentModel.ICustomTypeDescriptor GetTypeDescriptor (Type objectType, object instance);
public virtual System.ComponentModel.ICustomTypeDescriptor? GetTypeDescriptor (Type objectType, object? instance);
abstract member GetTypeDescriptor : Type * obj -> System.ComponentModel.ICustomTypeDescriptor
override this.GetTypeDescriptor : Type * obj -> System.ComponentModel.ICustomTypeDescriptor
Public Overridable Function GetTypeDescriptor (objectType As Type, instance As Object) As ICustomTypeDescriptor

參數

objectType
Type

要為其擷取型別描述項之物件的型別。

instance
Object

型別的執行個體。 如果未傳遞執行個體至 TypeDescriptor,可以為 null

傳回

ICustomTypeDescriptor,可以提供型別的中繼資料。

備註

如果未傳遞任何父提供者,這個方法的原型 virtual 為 ,而且根據預設,會傳回空的描述元。 如果傳遞父提供者,這個方法會叫用父提供者的 GetTypeDescriptor 方法。

給繼承者的注意事項

方法 GetTypeDescriptor(Type, Object) 應該會傳回 物件的自定義型別描述項。 如果 方法未提供 物件的型別資訊,它應該會傳回 null

另請參閱

適用於