请问用C#怎样实现ArcGIS Engine中的撤销功能
//撤消编辑publicvoidMapUndoEdit(IMappMap){IEngineEditPropertiesep=newEngineEditorClass();...
//撤消编辑
public void MapUndoEdit(IMap pMap)
{
IEngineEditProperties ep = new EngineEditorClass();
ILayer pCurrentLayer = ep.TargetLayer;
if (pCurrentLayer == null) return;
IFeatureLayer pFeatureLayer = (IFeatureLayer)pCurrentLayer;
IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
if (pDataset == null) return;
IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
bool bHasUndos = false;
pWorkspaceEdit.HasUndos(ref bHasUndos);
if (bHasUndos)
pWorkspaceEdit.UndoEditOperation();
IActiveView pActiveView = (IActiveView)pMap;
pActiveView.Refresh();
}
// 重复
public void MapRedoEdit(IMap pMap)
{
IEngineEditProperties ep = new EngineEditorClass();
ILayer pCurrentLayer = ep.TargetLayer;
if (pCurrentLayer == null) return;
IFeatureLayer pFeatureLayer = (IFeatureLayer)pCurrentLayer;
IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
if (pDataset == null) return;
IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
bool bHasUndos = false;
pWorkspaceEdit.HasUndos(ref bHasUndos);
if (bHasUndos)
pWorkspaceEdit.RedoEditOperation();
IActiveView pActiveView = (IActiveView)pMap;
pActiveView.Refresh();
}
这个该怎么调用啊! 展开
public void MapUndoEdit(IMap pMap)
{
IEngineEditProperties ep = new EngineEditorClass();
ILayer pCurrentLayer = ep.TargetLayer;
if (pCurrentLayer == null) return;
IFeatureLayer pFeatureLayer = (IFeatureLayer)pCurrentLayer;
IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
if (pDataset == null) return;
IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
bool bHasUndos = false;
pWorkspaceEdit.HasUndos(ref bHasUndos);
if (bHasUndos)
pWorkspaceEdit.UndoEditOperation();
IActiveView pActiveView = (IActiveView)pMap;
pActiveView.Refresh();
}
// 重复
public void MapRedoEdit(IMap pMap)
{
IEngineEditProperties ep = new EngineEditorClass();
ILayer pCurrentLayer = ep.TargetLayer;
if (pCurrentLayer == null) return;
IFeatureLayer pFeatureLayer = (IFeatureLayer)pCurrentLayer;
IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass;
if (pDataset == null) return;
IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace;
bool bHasUndos = false;
pWorkspaceEdit.HasUndos(ref bHasUndos);
if (bHasUndos)
pWorkspaceEdit.RedoEditOperation();
IActiveView pActiveView = (IActiveView)pMap;
pActiveView.Refresh();
}
这个该怎么调用啊! 展开
2个回答
展开全部
已经过时了,看最新的书吧,这个书做入门不太好,不建议,只能用来做参考书。
追问
难道你是来赚经验值的吗?怎么回答一样.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
已经过时了,看最新的书吧,这个书做入门不太好,不建议,只能用来做参考书。
追问
能介绍一下是什么书吗?用这个方法改怎么调用,能告诉我吗?
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询