TypeDescriptor.GetEditor Method

Definition

Returns an editor with the specified base type.

Overloads

GetEditor(Object, Type)

Gets an editor with the specified base type for the specified component.

GetEditor(Type, Type)

Returns an editor with the specified base type for the specified type.

GetEditor(Object, Type, Boolean)

Returns an editor with the specified base type and with a custom type descriptor for the specified component.

GetEditor(Object, Type)

Gets an editor with the specified base type for the specified component.

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

Parameters

component
Object

The component to get the editor for.

editorBaseType
Type

A Type that represents the base type of the editor you want to find.

Returns

An instance of the editor that can be cast to the specified editor type, or null if no editor of the requested type can be found.

Exceptions

component or editorBaseType is null.

component is a cross-process remoted object.

Remarks

The type of editorBaseType is usually UITypeEditor, but you can also use other types (for example, ComponentEditor and InstanceCreationEditor).

You can define multiple editors for a property. You use this method to select the editor you want to use.

See also

Applies to

GetEditor(Type, Type)

Returns an editor with the specified base type for the specified type.

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

Parameters

type
Type

The Type of the target component.

editorBaseType
Type

A Type that represents the base type of the editor you are trying to find.

Returns

An instance of the editor object that can be cast to the given base type, or null if no editor of the requested type can be found.

Exceptions

type or editorBaseType is null.

Remarks

The type of editorBaseType is usually UITypeEditor, but you can also use other types (for example ComponentEditor and InstanceCreationEditor).

You can define multiple editors for a type. You use this method to select the one you want to use.

Call this version of this method only when you do not have an instance of the object.

See also

Applies to

GetEditor(Object, Type, Boolean)

Returns an editor with the specified base type and with a custom type descriptor for the specified component.

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

Parameters

component
Object

The component to get the editor for.

editorBaseType
Type

A Type that represents the base type of the editor you want to find.

noCustomTypeDesc
Boolean

A flag indicating whether custom type description information should be considered.

Returns

An instance of the editor that can be cast to the specified editor type, or null if no editor of the requested type can be found.

Exceptions

component or editorBaseType is null.

component is a cross-process remoted object.

Remarks

The type of editorBaseType is usually UITypeEditor, but you can also use other types (for example ComponentEditor and InstanceCreationEditor).

You can define multiple editors for a property. You use this method to select the editor you want to use.

See also

Applies to