This document is archived and information here might be outdated.  Recommended version.


Obtaining the Category and Caption property information of a custom component (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > Developing with ArcGIS > Learning ArcObjects > Extending ArcObjects > Obtaining the Category and Caption property information of a custom component

Obtaining the Category and Caption property information of a custom component


Summary
Depending on how a custom component is created in Visual Studio, obtaining the Category and Caption property information looks different in the code base. This topic covers the ways to create custom components, which are implementing Component Object Model (COM) interfaces and Esri base classes.

In this topic


 

About obtaining the Category and Caption property information of a custom component

Review the following assumptions before proceeding:
  • An ArcGIS Desktop custom component - CustomComponent - was created based upon implementing COM interfaces or Esri base classes in Visual Studio.
  • The CustomComponent in this topic can show on the Customize dialog box of an ArcGIS Desktop application (that is, ArcMap, ArcGlobe, ArcScene, or ArcCatalog) and can be added to or removed from the ArcGIS Desktop graphical user interface (GUI). Typically these types of custom components are buttons, tools, and toolbars. Examples of custom components that do not show on the Customize dialog box and are not relevant for this topic are extensions, dockable windows, custom table of contents (TOCs), and so on.

    The following screen shot shows an example of an ArcMap Customize dialog box:


Obtaining the Category and Caption property information

Obtain the Category and Caption property information so CustomComponent users know what customization to add to the ArcMap GUI on the Customize dialog box. This section describes how to obtain the relevant information using both coding methods.

Using implemented COM interfaces

The Category and Caption information for CustomComponents generated by implementing COM interface classes is typically found in the Caption and Category methods. See the following code example:
[C#]
public string Caption
{
    get
    {
        return "Caption ArcMapClassLibrary_Implements";
    }
}

public string Category
{
    get
    {
        return "Developer Samples";
    }
}
[VB.NET]
Public ReadOnly Property Caption() As String Implements ESRI.ArcGIS.SystemUI.ICommand.Caption
Get
Return "Caption ArcMapClassLibrary_Implements"
End Get
End Property

Public ReadOnly Property Category() As String Implements ESRI.ArcGIS.SystemUI.ICommand.Category
Get
Return "Developer Samples"
End Get
End Property

Using Esri base classes

The Category and Caption information for CustomComponents generated by Esri base classes is typically found in the constructor for the class. In VB .NET, the information is in the MyBase.m_category and MyBase.m_caption properties. In C#, the information is in the base.m_category and base.m_caption properties. See the following code example:
[C#]
public Command1()
{
    base.m_category="Developer Samples";
    base.m_caption="Caption ArcMapClassLibrary_BaseCommand";
    base.m_message="Message - ArcMapClassLibrary_BaseCommand";
    base.m_toolTip="Tooltip - ArcMapClassLibrary_BaseCommand";
    base.m_name="Name - ArcMapClassLibrary_BaseCommand";

    //Additional code occurs here ...
}
[VB.NET]
Public Sub New()
    MyBase.New()
    
    MyBase.m_category="Developer Samples"
    MyBase.m_caption="Caption ArcMapClassLibrary_BaseCommand"
    MyBase.m_message="Message - ArcMapClassLibrary_BaseCommand"
    MyBase.m_toolTip="Tooltip - ArcMapClassLibrary_BaseCommand"
    MyBase.m_name="Name - ArcMapClassLibrary_BaseCommand"
    
    'Additional code occurs here ...
    
End Sub


See Also:

Deploying custom components
How to deploy a custom component using a setup project
How to ensure that COM component category and COM interop are used in custom components
ESRIRegAsm utility




Development licensing Deployment licensing
ArcGIS Desktop Basic ArcGIS Desktop Basic
ArcGIS Desktop Standard ArcGIS Desktop Standard
ArcGIS Desktop Advanced ArcGIS Desktop Advanced
Engine Developer Kit Engine