首页 > 代码库 > Geodatabase - 判断是否处于编辑状态

Geodatabase - 判断是否处于编辑状态

Engine中提供IDatasetEdit来判断数据是否处于编辑状态,我们知道,在ArcMap中,进行编辑的不一定都是要素类,也可以是表,网络几何等.以下能在ArcMap中进行编辑的数据都实现了 IDatasetEdit接口:

Classes that implement IDatasetEdit

ClassesDescription
AttributedRelationshipClassEsri Attributed Relationship Class object.
CadastralFabric (esriGeoDatabaseExtensions)A container for querying information about a cadastral fabric.
CadastralFabricFDExtension (esriGeoDatabaseExtensions)A container for describing this cadastral fabric‘s feature dataset extension properties.
FeatureClassEsri Feature Class object.
FeatureDatasetEsri Feature Dataset object.
GeometricNetworkEsri Geometric Network object.
NetworkDatasetA container for querying information about a network dataset.
NetworkDatasetFDExtensionA container for describing this network dataset‘s feature dataset extension properties.
NetworkDatasetWorkspaceExtensionA container for describing this network dataset‘s workspace extension properties.
ObjectClassEsri Object Class object.
RasterCatalogA collection of raster datasets in a Geodatabase table.
RouteEventSource (esriLocation)Route event source object.
SchematicDiagramClass (esriSchematic)Schematic diagram class object.
SchematicElementClass (esriSchematic)Schematic element class object.
SchematicInMemoryFeatureClass (esriSchematic)Schematic in memory feature class object.
StreetNetworkA container for describing a street network.
TableEsri Table object.
TemporalFeatureClass (esriTrackingAnalyst)Controls settings for the temporal feature class.
TemporalRecordSet (esriTrackingAnalyst)Defines the COM coclass for the TemporalRecordSet COM object.
TopologyEsri Topology object.
UtilityNetworkA container for describing a utility network.
XYEventSourceXY event source object.

如下代码演示了判断要素类是否处于编辑状态:

1 private void IsEditing() {2     ESRI.ArcGIS.Carto.ILayer lyr = mapCtrl_main.get_Layer(0);3     ESRI.ArcGIS.Carto.IFeatureLayer flyr = (ESRI.ArcGIS.Carto.IFeatureLayer)lyr;4 5     ESRI.ArcGIS.Geodatabase.IFeatureClass fclass = flyr.FeatureClass;6     ESRI.ArcGIS.Geodatabase.IDatasetEdit dsEdit = (ESRI.ArcGIS.Geodatabase.IDatasetEdit)fclass;7     bool isEditing = dsEdit.IsBeingEdited();8 }

 

Geodatabase - 判断是否处于编辑状态