Interface IExtensionConfig

Namespace
ESRI.ArcGIS.esriSystem
Assembly
ESRI.Server.System.dll

Provides access to members that describe an extension.

[Guid("12A4C258-CC9D-4CA7-9F29-79DED88DD45F")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IExtensionConfig

Remarks

The Extensions dialog in the ArcGIS applications allows users to turn extensions on and off. The IExtensionConfig interface is used to provide the Extension dialog with the name of the extension, a description of the extension, and specifies the state of the extension.

The esriExtensionState enumeration is used to specify whether the extension is enabled, disabled, or unavailable. The state of the extensions is user based. When an extension is installed, its default state is unchecked (esriESDisabled) and the user must knowingly check the extension on in the Extensions dialog box.

With a custom extension, you have full control over what happens when your extension is turned on or off. However, it is a good idea to follow the same design as the ArcGIS extensions. The following notes explain how the ArcGIS extensions work when they are turned on or off in the Extensions dialog.

When a user checks one of the ArcGIS extensions in the Extensions dialog box, the follow things occur:

  • The checked state of the extension is saved to the user settings in the registry. (This occurs automatically by the application so it is not something a developer needs to do.)
  • The extension requests a license from the license manager.
  • If a license is available, the tools are enabled on the toolbar delivered by the extension. 
  • If a license is not available, the tools are disabled on the toolbar delivered by the extension. Also, text stating that the license in not available is displayed to the right of the extension name in the Extensions dialog box.

When a user unchecks one of the ArcGIS extensions in the Extensions dialog box, the follow things occur:

  • The extension verifies that it is not being used within that application.
    • If the extension is being used within the application, the extension does not allow itself to be unchecked and a warning message is given.
    • If the extension is not being used within the application, the uncheck completes successfully and the remaining steps occur.
  • The unchecked state for the extension is saved in the user settings in the registry. (This occurs automatically by the application so it is not something a developer needs to do.)
  • If the toolbar for the extension is active, the appropriate tools are disabled.
  • The Extension lets the license manager know it is no longer using the extension license within the application and the license manager releases the license for that extension.

The IExtensionConfig interface is independent of ESRI's licensing approach so as a developer you can incorporate a custom licensing solution. Alternatively, if your extension doesn't work with a license manager, then you don't have to worry about requesting and releasing a license. You could implement IExtensionConfig simply to enable and disable the tools on your extension's toolbar accordingly.

[Visual Basic .NET]

The example code below enables the ArcGIS Spatial Analyst extension.

Sub EnableExtension()
  Dim pUID As New UID
  pUID.Value = “{3C5059FE-9F15-401A-94ED-EED914D73E3E}” ‘ Spatial Analyst  
  Dim pExtConfig As IExtensionConfig
  Set pExtConfig = Application.FindExtensionByCLSID(pUID)

If Not pExtConfig Is Nothing Then If (Not pExtConfig.State = esriESUnavailable) Then pExtConfig.State = esriESEnabled Else MsgBox “No licenses available” End If Else MsgBox “Extension is not installed” End If End Sub

Properties

Description

Detailed description of the extension.

string Description { get; }

Property Value

string

Remarks

Description is the text that is displayed for this extension in the About this extension box in the Extensions dialog.

ProductName

Name of the extension.

string ProductName { get; }

Property Value

string

Remarks

ProductName is the name that is displayed for this extension in the Extensions dialog.

State

The state of the extension.

esriExtensionState State { get; set; }

Property Value

esriExtensionState

Remarks

The esriExtensionState enumeration is used with this property to specify whether the extension is enabled, disabled, or unavailable. When the state is enabled, the extension is checked in the Extensions dialog. The checked state of the extension is saved in the user settings in the registry.

If the extension is terminated prematurely (for example, from interrupting a debugging session) the State will be set to 0.