ArcObjects Library Reference (GeoDatabase)  

IWorkspaceExtensionManager Interface

Provides access to members that manage a workspace extension.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Description
Read-only property Extension The workspace extension at this index.
Read-only property ExtensionCount The number of workspace extensions.
Method FindExtension Finds the specified workspace extension by its globally unique id.
Method RegisterExtension Registers this workspace extension with the database making it required for successful connection to this database.
Method UnRegisterExtension UnRegisters this workspace extension making it no longer required for successful connection to this database.

CoClasses that implement IWorkspaceExtensionManager

CoClasses and Classes Description
VersionedWorkspace VersionedWorkspace Object.
Workspace Workspace Object.

Remarks

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.

[C#]

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));
}

See Also

IWorkspace Interface