TypeDescriptor.GetEditor 方法

定义

使用指定的基类型返回编辑器。

重载

GetEditor(Object, Type)

获取指定组件的具有指定基类型的编辑器。

GetEditor(Type, Type)

返回具有指定基类型的指定类型的编辑器。

GetEditor(Object, Type, Boolean)

为指定组件返回具有指定基类型和自定义类型描述符的编辑器。

GetEditor(Object, Type)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
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为 ,但也可以使用其他类型的 (例如 和 ComponentEditorInstanceCreationEditor) 。

可以为一个属性定义多个编辑器。 使用此方法选择要使用的编辑器。

另请参阅

适用于

GetEditor(Type, Type)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
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)

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
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) 。

可以为一个属性定义多个编辑器。 使用此方法选择要使用的编辑器。

另请参阅

适用于