IComponentCategoryManager Interface

Provides access to members that work with the component category manager.

Description

The IComponentCategoryManager interface has methods that allow you to create a new component category, add or remove a particular object to or from a category, and add or remove all objects of a certain type to or from a category.

See the Component Categories topic for more details on the ComponentCatgeoryManager.

When To Use

Use the IComponentCategoryManagerinterface to programmatically add or remove components to or from a particular category. This interface has methods for creating a new component category, adding or removing a particular object to or from a category, and adding or removing all objects of a certain type to or from a category.

Members

Name Description
Method Create Creates a component category.
Method Setup Installs or uninstalls the objects that match the object type into the given category.
Method SetupObject Installs or uninstalls the given object into the given category.

IComponentCategoryManager.Create Method

Creates a component category.

Public Sub Create ( _
    ByVal Name As String, _
    ByVal Category As UID _
)
public void Create (
    string Name,
    UID Category
);

Description

_Name_is a string representing the name of the new category you are creating.

_Category_is an IUID object representing a new unique identifier for the category you are creating.

IComponentCategoryManager.Setup Method

Installs or uninstalls the objects that match the object type into the given category.

Public Sub Setup ( _
    ByVal pathname As String, _
    ByVal objectType As UID, _
    ByVal Category As UID, _
    ByVal install As Boolean _
)
public void Setup (
    string pathname,
    UID objectType,
    UID Category,
    bool install
);

Description

_PathName_is a string representing the full path and filename of the DLL containing the objects you want to register/unregister in a category.

_ObjectType_is an IUID object representing the unique identifier of the type of object you want to register/unregister in a category. This UID would be the ID of an interface.

_Category_is an IUID object representing the unique identifier of the category in which you are registering/unregistering the objects.

_install_specifies whether you are registering (True) or unregistering (False) the objects.

Remarks

The Setupmethod provides a means of registering more than one object stored in a DLL. Setup will QueryInterface (QI) each object in the DLL for the interface specified by ObjectType. If the QI succeeds, it will add that object to the component category specified by Category.

For example, you can have a single DLL that contains many commands (objects that implement ICommand). To register all the commands in this DLL with the commands category for ArcMap, you can set ObjectType to be the UID of the ICommand interface and set _Category_to be the UID of the ESRI Mx Commands category. You don't need to know the UID for each command. By calling Setup once, all the command objects in the DLL will be registered in this category.

If you use the SetupObjectmethod instead, you would have to call SetupObject many times; once for each command in the DLL.

IComponentCategoryManager.SetupObject Method

Installs or uninstalls the given object into the given category.

Public Sub SetupObject ( _
    ByVal pathname As String, _
    ByVal obj As UID, _
    ByVal Category As UID, _
    ByVal install As Boolean _
)
public void SetupObject (
    string pathname,
    UID obj,
    UID Category,
    bool install
);

Description

_PathName_is a string representing the full path and filename of the DLL containing the objects you want to register/unregister in a category.

_obj_is an IUID object representing the unique identifier of the object you want to register/unregister in a category. This UID would be the ID of a class.

_Category_is an IUID object representing the unique identifier of the category in which you are registering/unregistering the objects.

_install_specifies whether you are registering (True) or unregistering (False) the objects.

Remarks

The SetupObjectmethod provides a means of registering a specific object stored in a DLL.

For example, you can have a single DLL that contains many commands (objects that implement ICommand). If you want to register only one of the commands in this DLL with the commands category for ArcMap, you can set obj to be the UID of your command and set _Category_to be the UID of the ESRI Mx Commands category. By calling SetObject with these settings, only that specific command will be registered. If you want to register all the commands in the DLL you can either call SetupObject a number of times (once for each command) or use the Setupmethod instead. Setup allows you to register many objects at the same time with a single call.

Classes that implement IComponentCategoryManager

Classes Description
ComponentCategoryManager Component Category Manager Object.

Remarks

To get access to the IComponentCategoryManager interface create a new instance of a ComponentCategoryManager object.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.