IWorkspaceName Interface

Provides access to members that supply workspace name information.

When To Use

Use IWorkspaceName when you are browsing for workspaces and do not want the overhead of instantiating Workspace objects.

Members

Name Description
Read/write property BrowseName The browse name of the WorkspaceName.
Read-only property Category The category of the WorkspaceName.
Read/write property ConnectionProperties The connection properties of the WorkspaceName.
Read/write property PathName The path name of the WorkspaceName.
Read-only property Type The type of the associated workspace.
Read-only property WorkspaceFactory The workspace factory of the WorkspaceName.
Read/write property WorkspaceFactoryProgID The ProgID of the WorkspaceName's workspace factory.

IWorkspaceName.BrowseName Property

The browse name of the WorkspaceName.

Public Property BrowseName As String
public string BrowseName {get; set;}

IWorkspaceName.Category Property

The category of the WorkspaceName.

Public ReadOnly Property Category As String
public string Category {get;}

IWorkspaceName.ConnectionProperties Property

The connection properties of the WorkspaceName.

Public Property ConnectionProperties As IPropertySet
public IPropertySet ConnectionProperties {get; set;}

IWorkspaceName.PathName Property

The path name of the WorkspaceName.

Public Property PathName As String
public string PathName {get; set;}

IWorkspaceName.Type Property

The type of the associated workspace.

Public ReadOnly Property Type As esriWorkspaceType
public esriWorkspaceType Type {get;}

IWorkspaceName.WorkspaceFactory Property

The workspace factory of the WorkspaceName.

Public ReadOnly Property WorkspaceFactory As IWorkspaceFactory
public IWorkspaceFactory WorkspaceFactory {get;}

IWorkspaceName.WorkspaceFactoryProgID Property

The ProgID of the WorkspaceName's workspace factory.

Public Property WorkspaceFactoryProgID As String
public string WorkspaceFactoryProgID {get; set;}

Description

The WorkspaceFactoryProgID identifies the ProgID of the WorkspaceFactory object that is used to open that particular workspace.

Here is a list of some of the possible WorkspaceFactoryProgIDs:

  • esriDataSourcesGDB.AccessWorkspaceFactory
  • esriDataSourcesFile.ArcInfoWorkspaceFactory
  • esriDataSourcesFile.CadWorkspaceFactory
  • esriDataSourcesGDB.FileGDBWorkspaceFactory
  • esriDataSourcesOleDB.OLEDBWorkspaceFactory
  • esriDataSourcesFile.PCCoverageWorkspaceFactory
  • esriDataSourcesRaster.RasterWorkspaceFactory
  • esriDataSourcesGDB.SdeWorkspaceFactory
  • esriDataSourcesFile.ShapefileWorkspaceFactory
  • esriDataSourcesOleDB.TextFileWorkspaceFactory or esriDataSourcesFile.TextFileWorkspaceFactory
  • esriDataSourcesFile.TinWorkspaceFactory
  • esriDataSourcesFile.VpfWorkspaceFactory

Classes that implement IWorkspaceName

Classes Description
WorkspaceName Esri Workspace Name object.

Remarks

The IWorkspaceNameinterface lets you access the properties of a workspace name. To work with a workspace name, you must first set the WorkspaceFactoryProgIDproperty and either the PathNameor ConnectionProperties property.

The workspace name can refer to an existing workspace, or one that has yet to be created. If the workspace already exists, it can be opened with IName::Open--effectively this procedure is equivalent to opening a workspace using Openor OpenFromFileon IWorkspaceFactory. If the workspace does not exist and is to be created, use IWorkspaceFactory::Create.

In some circumstances, you may already have a full workspace object but require a workspace name instead. You can retrieve the workspace name from a workspace by calling calling IDataset::FullName on the workspace.

The Type,Category,WorkspaceFactoryProgID, and BrowseNameproperties all return information on the workspace; refer to the documentation on IWorkspace.

//e.g., workspacePath = "D:\data\geodatabases\Usa.mdb"

    public void IWorkspace__get_WorkspaceName(string workspacePath, IWorkspace workspace)

    {

        //Creates a new workspace name for a personal geodatabase.

        IWorkspaceName workspaceName = new WorkspaceNameClass();

        workspaceName.WorkspaceFactoryProgID = "esriDataSourcesGDB.AccessWorkspaceFactory";

        workspaceName.PathName = workspacePath;

        //Or Get a workspace name from an existing workspace.

        IDataset dataset = (IDataset)workspace; //Workspaces implement IDataset

        workspaceName = (IWorkspaceName)dataset.FullName;

    }

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.