TypeDescriptor.GetEditor 方法

定義

傳回具有指定基底型別的編輯器。

多載

GetEditor(Object, Type)

取得具有指定元件之指定基底類型的編輯器。

GetEditor(Type, Type)

傳回具有指定類型之指定基底類型的編輯器。

GetEditor(Object, Type, Boolean)

傳回具有指定基底類型與指定元件之自訂類型描述元的編輯器。

GetEditor(Object, Type)

來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs

取得具有指定元件之指定基底類型的編輯器。

public:
 static System::Object ^ GetEditor(System::Object ^ component, Type ^ editorBaseType);
public static object GetEditor (object component, Type editorBaseType);
public static object? GetEditor (object component, Type editorBaseType);
static member GetEditor : obj * Type -> obj
Public Shared Function GetEditor (component As Object, editorBaseType As Type) As Object

參數

component
Object

要為其取得編輯器的元件。

editorBaseType
Type

Type,代表您想要尋找之編輯器的基底類型。

傳回

編輯器的執行個體,可以轉型為指定的編輯器類型;如果找不到要求類型的編輯器,則為 null

例外狀況

componenteditorBaseTypenull

component 是跨處理序的遠端物件。

備註

editorBaseType的類型通常是 UITypeEditor,但您也可以使用其他類型的 (,ComponentEditor以及 InstanceCreationEditor) 。

您可以定義屬性的多個編輯器。 您可以使用這個方法來選取您想要使用的編輯器。

另請參閱

適用於

GetEditor(Type, Type)

來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs

傳回具有指定類型之指定基底類型的編輯器。

public:
 static System::Object ^ GetEditor(Type ^ type, Type ^ editorBaseType);
public static object GetEditor (Type type, Type editorBaseType);
public static object? GetEditor (Type type, Type editorBaseType);
static member GetEditor : Type * Type -> obj
Public Shared Function GetEditor (type As Type, editorBaseType As Type) As Object

參數

type
Type

目標元件的 Type

editorBaseType
Type

Type 代表您想要尋找之編輯器的基底類型。

傳回

編輯器的執行個體,可以轉型為指定的基底類型;如果找不到要求類型的編輯器,則為 null

例外狀況

typeeditorBaseTypenull

備註

editorBaseType的類型通常是 UITypeEditor,但您也可以使用其他類型的 (例如 ComponentEditorInstanceCreationEditor) 。

您可以定義類型的多個編輯器。 您可以使用這個方法來選取您要使用的方法。

只有在您沒有 對象的實例時,才呼叫這個版本的這個方法。

另請參閱

適用於

GetEditor(Object, Type, Boolean)

來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs

傳回具有指定基底類型與指定元件之自訂類型描述元的編輯器。

public:
 static System::Object ^ GetEditor(System::Object ^ component, Type ^ editorBaseType, bool noCustomTypeDesc);
public static object GetEditor (object component, Type editorBaseType, bool noCustomTypeDesc);
public static object? GetEditor (object component, Type editorBaseType, bool noCustomTypeDesc);
static member GetEditor : obj * Type * bool -> obj
Public Shared Function GetEditor (component As Object, editorBaseType As Type, noCustomTypeDesc As Boolean) As Object

參數

component
Object

要為其取得編輯器的元件。

editorBaseType
Type

Type,代表您想要尋找之編輯器的基底類型。

noCustomTypeDesc
Boolean

表示是否應該考慮自訂類型描述資訊的旗標。

傳回

編輯器的執行個體,可以轉型為指定的編輯器類型;如果找不到要求類型的編輯器,則為 null

例外狀況

componenteditorBaseTypenull

component 是跨處理序的遠端物件。

備註

editorBaseType的類型通常是 UITypeEditor,但您也可以使用其他類型的 (例如 ComponentEditorInstanceCreationEditor) 。

您可以定義屬性的多個編輯器。 您可以使用這個方法來選取您想要使用的編輯器。

另請參閱

適用於