public override void Execute(string argument) { ISmartViewer viewer = _smartSession.SmartWindowManager.ActiveViewer; if (viewer != null) { ICanvasViewer canViewer = viewer as ICanvasViewer; if (canViewer == null) { return; } IRasterDrawing rd = canViewer.ActiveObject as IRasterDrawing; IGeoPanAdjust adjust = rd as IGeoPanAdjust; if (adjust != null && adjust.IsHasUnsavedGeoAdjusted) { DialogResult ret = MsgBox.ShowQuestionYesNoCancel("对当前影像的平移校正结果未保存,请确认是否保存?\n按【是】保存。\n按【否】不保存。\n按【取消】返回。"); if (ret == DialogResult.Cancel) { return; } else if (ret == DialogResult.Yes) { adjust.Save(); } else { adjust.Cancel(); } } } _smartSession.UIFrameworkHelper.SetVisible(argument, false); _smartSession.UIFrameworkHelper.SetLockBesideX(argument, false); }
void _radDock_DockWindowClosing(object sender, DockWindowCancelEventArgs e) { _linkableViewerManager.Unlink(e.NewWindow as ILinkableViewer); if (e.NewWindow is IStatResultDisplayWindow) { (e.NewWindow as Telerik.WinControls.IGeoDoFree).Free(); } else if (e.NewWindow is ICanvasViewer) { ICanvasViewer canViewer = e.NewWindow as ICanvasViewer; IRasterDrawing rd = canViewer.ActiveObject as IRasterDrawing; IGeoPanAdjust adjust = rd as IGeoPanAdjust; if (adjust != null && adjust.IsHasUnsavedGeoAdjusted) { DialogResult ret = MsgBox.ShowQuestionYesNoCancel("当前影像的平移校正结果未保存,请确认是否保存?\n按【是】保存。\n按【否】不保存。\n按【取消】返回。"); if (ret == DialogResult.Cancel) { e.Cancel = true; return; } else if (ret == DialogResult.Yes) { adjust.Save(); } else { adjust.Cancel(); } } //退出平移校正状态 ICommand cmd = _session.CommandEnvironment.Get(30006); if (cmd != null) { cmd.Execute(); } //退出平移校正2状态 ICommand cmd2 = _session.CommandEnvironment.Get(30106); if (cmd2 != null) { cmd2.Execute(); } } }
public override void Execute() { ISmartViewer viewer = _smartSession.SmartWindowManager.ActiveViewer; if (viewer == null) { return; } ICanvasViewer canViewer = viewer as ICanvasViewer; IRasterDrawing rd = canViewer.ActiveObject as IRasterDrawing; PanAdjustControlLayer layer = canViewer.Canvas.CurrentViewControl as PanAdjustControlLayer; if (layer == null) { return; } IGeoPanAdjust adjust = rd as IGeoPanAdjust; adjust.Save(); canViewer.Canvas.CurrentViewControl = new DefaultControlLayer(); canViewer.Canvas.Refresh(Core.DrawEngine.enumRefreshType.All); }