public override void RestoreEnv() { if (this._uc != null) { this._uc.RestoreEnv(); this._uc.Dispose(); this._uc = null; } if (this._uPanel != null) { this._uPanel.GetControlContainer().Controls.Clear(); this._uPanel.Close(); this._uPanel = null; } IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } //app.Workbench.SetMenuEnable(true); IGraphicsContainer gc = app.Current2DMapControl.Map as IGraphicsContainer; gc.DeleteAllElements(); app.Current2DMapControl.ActiveView.Refresh(); mapView.UnBind(this); WaitForm.Stop(); Map2DCommandManager.Pop(); }
public override void Run(object sender, System.EventArgs e) { try { if (DF3DApplication.Application == null || DF3DApplication.Application.Current3DMapControl == null) { return; } d3 = DF3DApplication.Application.Current3DMapControl; if (!d3.Terrain.IsRegistered) { return; } Map3DCommandManager.Push(this); d3.Terrain.DemAvailable = true; DF3DApplication.Application.Workbench.UpdateMenu(); List <DF3DFeatureClass> list = Dictionary3DTable.Instance.GetFeatureClassByFacilityClassName("DX3DMODEL"); if (list != null) { dict = new Dictionary <IBaseLayer, bool>(); foreach (DF3DFeatureClass dffc in list) { IBaseLayer bl = dffc.GetTreeLayer(); dict[bl] = bl.Visible; if (bl != null) { bl.Visible = false; } } } this._uPanel = new UIDockPanel("开挖分析", "开挖分析", this.Location, this._width, this._height); this._dockPanel = FloatPanelManager.Instance.Add(ref this._uPanel, DockingStyle.Right); this._dockPanel.Visibility = DockVisibility.Visible; this._dockPanel.FloatSize = new System.Drawing.Size(this._width, this._height); this._dockPanel.Width = this._width; this._dockPanel.Height = this._height; this._uc = new UCEarthworkCalculation(); this._uc.Dock = System.Windows.Forms.DockStyle.Fill; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); } catch (Exception ex) { LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace); } }
public override void Run(object sender, System.EventArgs e) { try { Map2DCommandManager.Push(this); IMap2DView mapView = UCService.GetContent(typeof(Map2DView)) as Map2DView; if (mapView == null) { return; } bool bBind = mapView.Bind(this); if (!bBind) { return; } DF2DApplication app = DF2DApplication.Application; if (app == null || app.Current2DMapControl == null || app.Workbench == null) { return; } //app.Workbench.SetMenuEnable(false); m_ActiveView = app.Current2DMapControl.ActiveView; m_Display = app.Current2DMapControl.ActiveView.ScreenDisplay; _gc = app.Current2DMapControl.ActiveView.GraphicsContainer; _gc.DeleteAllElements(); app.Current2DMapControl.MousePointer = esriControlsMousePointer.esriPointerArrow; this._uPanel = new UIDockPanel("开挖分析", "开挖分析", this.Location, this._width, this._height); this._dockPanel = FloatPanelManager.Instance.Add(ref this._uPanel, DockingStyle.Right); this._dockPanel.Visibility = DockVisibility.Visible; this._dockPanel.FloatSize = new System.Drawing.Size(this._width, this._height); this._dockPanel.Width = this._width; this._dockPanel.Height = this._height; this._uc = new UCEarthworkCalculation(); this._uc.Dock = System.Windows.Forms.DockStyle.Top; this._uPanel.RegisterEvent(new PanelClose(this.Close)); this._dockPanel.Controls.Add(this._uc); } catch (System.Exception ex) { } }
public override void RestoreEnv() { if (dict != null) { foreach (KeyValuePair <IBaseLayer, bool> kv in dict) { kv.Key.Visible = kv.Value; } } if (this._uc != null) { this._uc.RestoreEnv(); this._uc.Dispose(); this._uc = null; } if (this._uPanel != null) { this._uPanel.GetControlContainer().Controls.Clear(); this._uPanel.Close(); this._uPanel = null; } Map3DCommandManager.Pop(); }