Provides access to members that define an extension.
Description
IExtension is implemented by developers of custom extensions. You do not normally use this interface from client code, other than to get the name of the extension.
Any extension that is registered with an application is automatically loaded and unloaded by the application; the end user does nothing to load or unload. For example, an extension that has been added to the ESRI Mx Extensions category will be started when ArcMap is started and will be shutdown when ArcMap is shutdown.
When To Use
Use the IExtension interface to query the properties of an extension or to create your own extension.
When you are creating a new extension, you need to implement the IExtension interface in your class code. This interface allows you to set the name of the extension and specify what action takes place when the extension is started or shutdown.
Members
Name | Description | |
---|---|---|
![]() |
Name | The name of the extension. |
![]() |
Shutdown | Shuts down the extension. |
![]() |
Startup | Starts up the extension with the given initialization data. |
IExtension.Name Property
The name of the extension.
Public ReadOnly Property Name As String
public string Name {get;}
Remarks
When implementing IExtension to create a custom extension, use theName property to set the name of this extension.
If you implement persistence (e.g. IPersistVariant) for the extension, the length of the Name property cannot exceed 31 characters.
IExtension.Shutdown Method
Shuts down the extension.
Public Sub Shutdown ( _
)
public void Shutdown (
);
Remarks
When implementing IExtension to create a custom extension, use the Shutdown method to perform some action when the extension gets unloaded.
IExtension.Startup Method
Starts up the extension with the given initialization data.
Public Sub Startup ( _
ByRef initializationData As Object _
)
public void Startup (
ref object initializationData
);
Description
initializationData is a reference to the object with which this extension is registered.
Remarks
When implementing IExtension to create a custom extension, use the Startup method to perform some action when the extension gets loaded.
The following list is an example of some of the common object types for the initializationData parameter.****
Extension Category initializationData object typeESRI Mx Application Application (IMxApplication)ESRI Gx Applcation Application (IGxApplication)ESRI Editor Extensions Editor (IEditor)
Classes that implement IExtension
Classes | Description |
---|---|
DddServerEnvironment (esriGeoDatabase) | 3D Server Environment (license) singleton object. |
LicensedDataExtension (esriDataSourcesFile) | The Licensed Data Extension. |
Remarks
If you want your extension to be exposed in the Extensions dialog, you would also implement the IExtensionConfiginterface. The class module for your extension would implement both IExtension and IExtensionConfig.