IWorkspaceFactory接口

时间:2024-08-28 14:06:08

When To Use

Use IWorkspaceFactory when you need to create a new workspace, connect to an existing workspace or find information about a workspace.

Members

  All
Properties
Methods
Description
IWorkspaceFactory接口 ContainsWorkspace Indicates if parentDirectory contains a valid workspace, or is a valid file-system workspace.
IWorkspaceFactory接口 Copy Copies a workspace to the specified destination folder.
IWorkspaceFactory接口 Create Creates a new workspace specified by the directory, file name, and connection properties.
IWorkspaceFactory接口 GetClassID The class ID of the WorkspaceFactory.
IWorkspaceFactory接口 GetWorkspaceName Retrieves the workspace name of a workspace from the given list of file names.
IWorkspaceFactory接口 IsWorkspace True if the specified file identifies a workspace supported by the workspace factory.
IWorkspaceFactory接口 Move Moves a workspace to the specified destination folder.
IWorkspaceFactory接口 Open Opens the workspace specified by the connection properties.
IWorkspaceFactory接口 OpenFromFile Opens the workspace specified by the given file name.
IWorkspaceFactory接口 ReadConnectionPropertiesFromFile The connection properties from the specified file.
IWorkspaceFactory接口 WorkspaceDescription A singular or plural description of the type of workspace the workspace factory opens/creates.
IWorkspaceFactory接口 WorkspaceType The type of workspace the workspace factory opens/creates.

Classes that implement IWorkspaceFactory

Classes Description
AccessWorkspaceFactory (esriDataSourcesGDB) ESRI Access Workspace Factory.
AMSWorkspaceFactory (esriTrackingAnalyst) Controls functionality for the tracking workspace factory.
ArcInfoWorkspaceFactory (esriDataSourcesFile) Workspace factory used to create workspace objects for
ArcInfo coverages and Info tables.
CadWorkspaceFactory (esriDataSourcesFile) ESRI Cad Workspace Factory.
ExcelWorkspaceFactory (esriDataSourcesOleDB) Excel Workspace Factory.
FileGDBWorkspaceFactory (esriDataSourcesGDB) File GeoDatabase Workspace Factory.
GeoRSSWorkspaceFactory (esriDataSourcesFile) GeoRSS workspace factory.
IMSWorkspaceFactory (esriGISClient) The IMS Workspace Factory.
InMemoryWorkspaceFactory (esriDataSourcesGDB)  
NetCDFWorkspaceFactory (esriDataSourcesNetCDF) Provides access to members that control creation of NetCDF workspaces.
OLEDBWorkspaceFactory (esriDataSourcesOleDB) OleDB Workspace Factory.
PCCoverageWorkspaceFactory (esriDataSourcesFile) ESRI PC ARC/INFO Workspace Factory.
PlugInWorkspaceFactory ESRI Plug-In Workspace Factory.
RasterWorkspaceFactory (esriDataSourcesRaster) Provides access to members that control creation of raster workspaces.
SDCWorkspaceFactory (esriDataSourcesFile) ESRI SDC workspace factory.
SdeWorkspaceFactory (esriDataSourcesGDB) ESRI SDE Workspace Factory.
ShapefileWorkspaceFactory (esriDataSourcesFile) ESRI Shapefile Workspace Factory.
SqlWorkspaceFactory (esriDataSourcesGDB) Sql workspace factory
StreetMapWorkspaceFactory (esriDataSourcesFile) ESRI StreetMap workspace factory.
TextFileWorkspaceFactory (esriDataSourcesOleDB) Text File Workspace Factory.
TinWorkspaceFactory (esriDataSourcesFile) ESRI TIN workspace factory is used to access TINs on disk.
ToolboxWorkspaceFactory (esriGeoprocessing) Workspace Factory used to open toolbox workspaces.
VpfWorkspaceFactory (esriDataSourcesFile) ESRI VPF Workspace Factory
WorkspaceFactory WorkspaceFactory Object.

Remarks

A WorkspaceFactory is a dispenser of workspaces and allows a client to connect to a workspace specified by a set of connection properties. A workspace represents a database or a datasource that contains one or more datasets. Examples of datasets include tables, feature classes and relationship classes. A WorkspaceFactory is a cocreatable, singleton object. Connection properties are specified using a PropertySet object and can be saved to a connection file. A WorkspaceFactory also supports methods that can be used to browse and manage file system workspaces, and methods to manage connection files for remote database workspaces.

Each workspace factory maintains a pool of currently connected, active workspaces that are referenced by the application. When any of the Open* methods is called, the workspace factory first checks to see if a workspace has previously been opened with a matching set of properties. If so, a reference to the existing instance is returned. In the case of ArcSDE workspaces, when an application connects to a workspace but omits some connection properties (such as username, password, or version), the workspace factory will check a set of "core" properties - SERVER, INSTANCE, and AUTHENTICATION_MODE - to see they match any open workspaces. If so, the workspace factory will return a reference to the matching workspace.

.NET Snippets

Open Raster File As GeoDatset | Set Data Source | Get FeatureClass From Shapefile On Disk | Add Shapefile Using OpenFileDialog | Create Grid From Feature Class | Add Tracking Layer To Map |