public void OnClick() { try { m_Map = m_hookHelper.FocusMap; m_activeView = m_Map as IActiveView; m_EngineEditor = MapManager.EngineEditor; if (m_EngineEditor == null) { return; } if (m_EngineEditor.EditState != esriEngineEditState.esriEngineStateEditing) { return; } IWorkspaceEdit pWSEdit = m_EngineEditor.EditWorkspace as IWorkspaceEdit; if (pWSEdit == null) { return; } Boolean bHasRedo = true; pWSEdit.HasRedos(ref bHasRedo); if (bHasRedo) { pWSEdit.RedoEditOperation(); } m_activeView.Refresh(); } catch (Exception ex) { } }
public bool IsValid(object caller, ICSharpCode.Core.Condition condition) { bool hasRedos = false; DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null) { return(false); } IWorkspaceEdit pWorkspaceEdit = Class.Common.CurWspEdit; if (pWorkspaceEdit == null) { return(false); } if (pWorkspaceEdit.IsBeingEdited()) { pWorkspaceEdit.HasRedos(ref hasRedos); if (hasRedos) { return(true); } else { return(false); } } else { return(false); } }
//重做 public static void RedoEdit(AxMapControl axmap, ILayer player) { // Check that editing is possible m_CurrentLayer = player; m_MapControl = axmap; if (m_CurrentLayer == null) { return; } IFeatureLayer pFeatureLayer = (IFeatureLayer)m_CurrentLayer; IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass; if (pDataset == null) { return; } /// If edits have taken place then roll-back the last one IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace; bool bHasUndos = false; pWorkspaceEdit.HasRedos(ref bHasUndos); if (bHasUndos) { pWorkspaceEdit.RedoEditOperation(); } IActiveView pActiveView = (IActiveView)m_MapControl.Map; pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, pActiveView.Extent); pActiveView.Refresh(); }
/// <summary> /// 重做已撤消的编辑 /// </summary> public void RedoEdit() { bool bHasRedos = false; try { if (m_pCurrentLayer == null) { return; } IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pCurrentLayer; IDataset pDataset = (IDataset)pFeatureLayer.FeatureClass; if (pDataset == null) { return; } IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)pDataset.Workspace; pWorkspaceEdit.HasRedos(ref bHasRedos); if (bHasRedos) { pWorkspaceEdit.RedoEditOperation(); } IActiveView pActiveView = (IActiveView)m_pMap; pActiveView.Refresh(); } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } }
/// <summary> /// 恢复操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void m_redotool_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (pEngineEditor.EditState == esriEngineEditState.esriEngineStateEditing) { m_redotool.Enabled = true; IWorkspaceEdit workspaceedit = (IWorkspaceEdit)pEngineEditor.EditWorkspace; bool bHasRedo = true; workspaceedit.HasRedos(ref bHasRedo); if (bHasRedo) { workspaceedit.RedoEditOperation(); ((IActiveView)m_mapControl.Map).Refresh(); } } }
public void RedoEdit() { if (MyselectedLayer == null) { return; } IFeatureLayer featLayer = MyselectedLayer as IFeatureLayer; IDataset dataset = featLayer.FeatureClass as IDataset; IWorkspaceEdit workspaceEdit = dataset.Workspace as IWorkspaceEdit; bool bHasUndos = false; workspaceEdit.HasRedos(ref bHasUndos); if (bHasUndos) { workspaceEdit.RedoEditOperation(); } ClearSelection(); }
public override void OnClick() { if (m_Hook == null) { return; } //LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); //if (log != null) //{ // log.Writelog("鹰眼图设置"); //} if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { IWorkspaceEdit iWE = ((getEditLayer.isExistLayer(m_Hook.ArcGisMapControl.Map) as IFeatureLayer).FeatureClass as IDataset).Workspace as IWorkspaceEdit; if (iWE.IsBeingEdited()) { bool hasEdits = false; iWE.HasRedos(ref hasEdits); if (hasEdits && MessageBox.Show("是否重做编辑?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { iWE.RedoEditOperation(); } } m_Hook.ArcGisMapControl.ActiveView.Refresh(); iWE = null; } catch { } }