版本
ArcGis 10.1,C#
编辑流程
流程:StartEditing--> StartEditOperation --> StopEditOperation或者AbortEditOperation --> StopEditing
StartEditing(boolean) 开启编辑会话,true允许重做或回退,false不允许重做或回退
StopEditing(boolean) 结束编辑会话,true保存编辑,false不保存编辑
StartEditOperation()开始一个编辑操作
StopEditOperation()结束一个编辑操作
AbortEditOperation()取消一个编辑操作
编辑操作不能嵌套
编辑代码
IFeatureLayer pFeatureLayer=ArcMap.Document.FocusMap.get_Layer(0) as IFeatureLayer;
IDataset pDataset = pFeatureLayer.FeatureClass as IDataset;
IWorkspace pWs = pDataset.Workspace;
IWorkspaceEdit pWorkspaceEdit = pWs as IWorkspaceEdit;
pWorkspaceEdit.StartEditing(true);
pWorkspaceEdit.StartEditOperation();
//编辑代码
//结束编辑
pWorkspaceEdit.StopEditOperation();
pWorkspaceEdit.StopEditing(true);