TypeDescriptor.AddEditorTable Method (Type, Hashtable)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Adds an editor table for the given editor base type.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public static void AddEditorTable(
	Type editorBaseType,
	Hashtable table


Type: System.Type

The editor base type to add the editor table for. If a table already exists for this type, this method will do nothing.

Type: System.Collections.Hashtable

The Hashtable to add.

The AddEditorTable method adds an editor table for the given editor base type. Typically, editors are specified as metadata on a component. However, if no metadata for a requested editor base type can be found on the component, the associated TypeDescriptor will search an editor table for the editor type, if one can be found. Once an editor table has been added to a type descriptor, it cannot be removed and is owned by the type descriptor. The type descriptor may freely make modifications to this table.

The format for an editor table uses data types as keys and editors as values. The value portion of an entry in the table represents an editor instance. It can have one of three values. If it contains a string, the type descriptor will assume this is a fully qualified name of a type, and then load the type for the object. If it contains a type, an instance of this type will be created to obtain an editor. Finally, the value portion may contain an actual editor instance. If the type descriptor resolves an editor to an instance, it will store the instance back into the table for future use.

.NET Framework
Available since 1.1
Return to top