Extension implementation


PurposeThis sample illustrates different implementations of application extensions in ArcGIS. The SimpleExtension class contains the minimal implementation of IExtension, which listens to document events. Examples of configurable extensions are shown by the ArcViewOnlyExtension, ArcEditorOnlyExtension, and ArcInfoOnlyExtension classes in the project. The extension state of these implementations can be toggled in the Extension Manager dialog box and is only enabled when the appropriate product license is running in the current application.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Open and compile the sample project in Visual Studio. If necessary, set up a debug application.
  2. Start ArcCatalog, ArcMap, ArcScene, or ArcGlobe (this sample works in any of these applications).
  3. Create or open a document. If you are debugging, select the Output Window in Visual Studio where the SimpleExtension class prints debugging information, which indicates it is listening to document events.
  4. Click the Customize menu, and click Extensions. The Extension Manager dialog box opens.
  5. Select one of the sample extensions to view its associated description shown at the bottom of the dialog box.
  6. Verify the product license your application is running against and select the appropriate sample extension on the dialog box. For example, if you are running an ArcInfo license, select ArcInfo Extension (C#) or ArcInfo Extension (VB .NET) from the list; extension checking will be successful, therefore, you can check the extension off.
  7. If you check the other product extension on, an error similar to the standard ArcGIS extensions appears, indicating it is unavailable.
  8. Close, then open the Extension Manager dialog box. The License not available message appears next to the extensions that you did not enable.

ArcEditorOnlyExtension.cs A configurable extension only available with an ArcEditor product license.
ArcInfoOnlyExtension.cs A configurable extension only available with an ArcInfo product license.
ArcViewOnlyExtension.cs A configurable extension only available with an ArcView product license.
SimpleExtension.cs Simple extension listening to document events.
Download the C# files
ArcEditorOnlyExtension.vb A configurable extension only available with an ArcEditor product license.
ArcInfoOnlyExtension.vb A configurable extension only available with an ArcInfo product license.
ArcViewOnlyExtension.vb A configurable extension only available with an ArcView product license.
SimpleExtension.vb Simple extension listening to document events.
Download the VB.NET files

Download the files for all languages

See Also:

Creating an application extension




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced