TypeDescriptor.GetEditor 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回具有指定基底型別的編輯器。
GetEditor(Object, Type) |
取得具有指定元件之指定基底類型的編輯器。 |
GetEditor(Type, Type) |
傳回具有指定類型之指定基底類型的編輯器。 |
GetEditor(Object, Type, Boolean) |
傳回具有指定基底類型與指定元件之自訂類型描述元的編輯器。 |
取得具有指定元件之指定基底類型的編輯器。
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
要為其取得編輯器的元件。
傳回
編輯器的執行個體,可以轉型為指定的編輯器類型;如果找不到要求類型的編輯器,則為 null
。
例外狀況
component
或 editorBaseType
為 null
。
component
是跨處理序的遠端物件。
備註
editorBaseType
的類型通常是 UITypeEditor,但您也可以使用其他類型的 (,ComponentEditor以及 InstanceCreationEditor) 。
您可以定義屬性的多個編輯器。 您可以使用這個方法來選取您想要使用的編輯器。
另請參閱
適用於
傳回具有指定類型之指定基底類型的編輯器。
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
參數
傳回
編輯器的執行個體,可以轉型為指定的基底類型;如果找不到要求類型的編輯器,則為 null
。
例外狀況
type
或 editorBaseType
為 null
。
備註
editorBaseType
的類型通常是 UITypeEditor,但您也可以使用其他類型的 (例如 ComponentEditor 和 InstanceCreationEditor) 。
您可以定義類型的多個編輯器。 您可以使用這個方法來選取您要使用的方法。
只有在您沒有 對象的實例時,才呼叫這個版本的這個方法。
另請參閱
適用於
傳回具有指定基底類型與指定元件之自訂類型描述元的編輯器。
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
要為其取得編輯器的元件。
- noCustomTypeDesc
- Boolean
表示是否應該考慮自訂類型描述資訊的旗標。
傳回
編輯器的執行個體,可以轉型為指定的編輯器類型;如果找不到要求類型的編輯器,則為 null
。
例外狀況
component
或 editorBaseType
為 null
。
component
是跨處理序的遠端物件。
備註
editorBaseType
的類型通常是 UITypeEditor,但您也可以使用其他類型的 (例如 ComponentEditor 和 InstanceCreationEditor) 。
您可以定義屬性的多個編輯器。 您可以使用這個方法來選取您想要使用的編輯器。