In this topic
Component category registrar options
Much of the extensibility of ArcGIS relies on Component Object Model (COM) categories. Classes written in .NET can be automatically registered in a particular component category by adding COM registration functions in the code. There are a large number of ESRI component categories you can register your class to. With the help of the classes defined in the ESRI.ArcGIS.ADF.CATIDs namespace, the ArcGIS Component Category Registrar dialog box automates the task of stubbing out category registration functions in your .NET class to enable self-component category registration.
For more information on COM registration functions, see COMRegisterFunctionAttribute and COMUnregistrationFunctionAttribute in System.Runtime.InteropServices. You can find step-by-step information on using the different elements of the ArcGIS Visual Studio IDE Integration Framework in the .NET development walkthroughs.
To view the ArcGIS Component Category Registrar dialog box, choose Add Component Category from the Project menu. It is also shown as a page in the ArcGIS Add Class Wizard. See the following screen shot:
Component category registrar descriptions
The following describes each area on the ArcGIS Component Category Registrar dialog box:
- Current Project - Shows the name of the active project.
- Register for COM Interop - Only available in class library projects. If the project is not already registered for COM interop, this option allows you to set the project-level Register for COM Interop setting. If your project is already registered for COM interop, this option is unavailable.
- Class - This drop-down list allows you to select the class to which the component category registration applies. Only classes that are exposed to COM are added to the list. When class selection changes, the active document in Visual Studio is switched to show the code file accordingly.
Classes written in C# are eligible to be exposed to COM when the access modifier is set to public and the ComVisible class attribute is set to true (if missing, it defaults to true). For VB .NET classes, the ComClass attribute must be applied.
- Categories - The Categories list displays ESRI component categories. Check the check box next to the category or categories to which you want to register the class (the class indicated in the Class drop-down list). Clicking OK adds COM registration functions to the selected class. Categories are sorted alphabetically by the first column, and sorting can be switched from normal to checked first by clicking the heading of the first column. Columns can be reordered by dragging and dropping the column heading.
- Names - The user-friendly name of the component category.
- Category IDs - The class in the ESRI.ArcGIS.ADF.CATIDs namespace that is responsible for registering the class to the corresponding component category in the COM registration functions.
- More Component Categories - By default, only those categories more commonly used are displayed. Change the categories in this list by scrolling to the end of the list and clicking More Component Categories to access the Select Component Categories dialog box. Component categories are organized into groups, and the list can be changed or reset to the default setting (*Common group) using this dialog box.
- Category Properties - The category properties grid, shown on the right of the dialog box, displays information about the component category currently selected in the categories list.
- Custom Category Properties - When particular component categories are selected in the Categories list, the category properties grid shows a Custom Property section, allowing you to further customize your class. For example, for CommandBar component categories, such as ArcCatalog Command Bar (GxCommandBars), it is possible to additionally register the selected class as a premier toolbar. Premier toolbars automatically appear the first time the target application is run after the toolbar is installed, without the user choosing to display that toolbar.
See Also:
ArcGIS Visual Studio IDE Integration Framework for extending ArcObjectsUsing the ArcGIS Add Class Wizard to extend ArcObjects
Registering classes in COM component categories