Extensions


PurposeThis sample illustrates different implementations of application extension in ArcGIS. The SimpleExtension class contains the minimal implementation of IExtension which listen 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 and is only enabled when the appropriate product license is running in the current application.

Development licensing Deployment licensing
ArcView ArcView
ArcEditor ArcEditor
ArcInfo ArcInfo

How to use

See Using the samples for help on compiling, setting up the debugger, and running the sample (either an exe or dll).

  1. Open and compile the sample project in Visual Studio 2005. Set up debug application if needed.
  2. This sample works in ArcCatalog, ArcMap, ArcScene or ArcGlobe. Open any of the applications.
  3. Create or open a document. If you are debugging, check the Output Window in Visual Studio where the SimpleExtension class prints debugging information indicating it is listening to document events.
  4. Open the Extension Manager dialog from Tools > Extensions… on the main menu.
  5. Select to highlight one of the sample extensions to see its associated description displayed at the bottom of the dialog.
  6. Take a note of what product license your application is currently running against and check on the appropriate sample extension in the dialog.
  7. For example, if you are running ArcInfo license, check "ArcInfo Extension (C#)" or "ArcInfo Extension (VB.Net)" from the list. Extension checking will be successful. You can then check the extension off.
  8. If you attempt to check the other product extension on, you will receive an error similar to the standard ArcGIS extensions, indicating it is unavailable.
  9. Close and reopen the Extension Manager dialog. You will see the "(License not available)" message next to the extensions which you have failed to enable.

ArcEditorOnlyExtension.cs A configurable extension only available with ArcEditor product license
ArcInfoOnlyExtension.cs A configurable extension only available with ArcInfo product license
ArcViewOnlyExtension.cs A configurable extension only available with ArcView product license
DesktopExtensionsCS.csproj C# project file
DesktopExtensionsCS.sln Solution file
SimpleExtension.cs Simple extension listening to document events
Download the C# files
ArcEditorOnlyExtension.vb A configurable extension only available with ArcEditor product license
ArcInfoOnlyExtension.vb A configurable extension only available with ArcInfo product license
ArcViewOnlyExtension.vb A configurable extension only available with ArcView product license
DesktopExtensionsVB.sln Solution file
DesktopExtensionsVB.vbproj VB.Net project file
SimpleExtension.vb Simple extension listening to document events
Download the VB.NET files

Download the files for all languages

See Also:

How to create an application extension