This document is archived and information here might be outdated. Recommended version. |
Provides access to members that manage a workspace extension.
Name | Description | |
---|---|---|
Extension | The workspace extension at this index. | |
ExtensionCount | The number of workspace extensions. | |
FindExtension | Finds the specified workspace extension by its globally unique id. | |
RegisterExtension | Registers this workspace extension with the database making it required for successful connection to this database. | |
UnRegisterExtension | UnRegisters this workspace extension making it no longer required for successful connection to this database. |
CoClasses and Classes | Description |
---|---|
VersionedWorkspace | VersionedWorkspace Object. |
Workspace | Workspace Object. |
IWorkspaceExtensionManager is an optional interface supported by Personal, File and ArcSDE geodatabase workspaces. The FindExtension method returns a reference to a workspace extension given its GUID. An application can also discover and iterate over all extensions using the ExtensionCount and Extension properties.
The following code demonstrates how to get a reference to the IWorkspaceExtensionManager in order to access the IDatasetContainer2. The end result of which could be to create a network dataset or find a pre-existing network dataset. The code assumes you have a reference to the workspace (workspace) in which the network dataset will be created or exists. The workspace could also correspond to the folder containing a shapefile network dataset or SDC data.
public void esriGeoDatabase__IWorkspaceExtensionManager(IWorkspace workspace)
{
// Cast to the IWorkspaceExtensionManager interface
IWorkspaceExtensionManager workspaceextensionManager=(IWorkspaceExtensionManager)workspace;
// Set the UID value for the workspace extention which we want to use
UID uid=new UID();
uid.Value="esriGeoDatabase.NetworkDatasetWorkspaceExtension";
// Get the DatasetContainer for the workspace extension
IWorkspaceExtension workspaceExtension=workspaceextensionManager.FindExtension(uid);
IDatasetContainer2 datasetContainer2=(IDatasetContainer2)workspaceExtension;
Console.WriteLine(datasetContainer2.get_DatasetCount(esriDatasetType.esriDTNetworkDataset));
}
IWorkspace Interface | IWorkspaceExtensionControl Interface