public override void Execute() { if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } try { m_MapControl = m_App.CurrentMapControl; m_ActiveView = m_App.CurrentMapControl.ActiveView; m_FocusMap = m_ActiveView.FocusMap; UltraToolbarsManager tbManager; tbManager = m_App.Workbench.CommandBarManager; ComboBoxTool tbUltraCombo; tbUltraCombo = (ComboBoxTool)tbManager.Tools["2dmap.Scale"]; IDisplayTransformation pDisplayTransform = m_App.CurrentMapControl.ActiveView.ScreenDisplay.DisplayTransformation; pDisplayTransform.ScaleRatio = tbUltraCombo.Value == null?1000:double.Parse(tbUltraCombo.Value.ToString()); m_ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, m_MapControl.Extent); } catch (Exception ex) { Console.WriteLine(ex.Message + ex.StackTrace); } }
public override void Execute() { base.Execute(); if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } m_MapView.CurrentTool = this; m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_pStatusBarService = m_App.StatusBarService; //获得状态服务 CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.CalculateZimuth; CommonFunction.MapRefresh(m_pActiveView); }
public override void Execute() { if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; m_pActiveView = m_App.CurrentMapControl.ActiveView; m_FocusMap = m_pActiveView.FocusMap; if (m_MapView == null) { return; } else { //绑定事件 m_MapView.CurrentTool = this; } CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.selectFeature; CommonFunction.MapRefresh(m_pActiveView); }
public override void Execute() { if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } else { //绑定事件 //m_MapView.CurrentTool = this; } m_MapControl = m_App.CurrentMapControl; WSGRI.DigitalFactory.DFEditorTool.frmEditSet fromEditSet = new frmEditSet(); fromEditSet.m_CfgSet = m_App.CurrentConfig; fromEditSet.m_pActiveView = m_App.CurrentMapControl.ActiveView; fromEditSet.ShowDialog(); }
public override void Execute() { if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } else { //绑定事件 //m_MapView.CurrentTool = this; } m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_App.CurrentMapControl.ActiveView.FocusMap; CommonFunction.StartEditing(m_FocusMap); m_App.IsModifyWorkSpace = true; UltraToolbarsManager tbManager; tbManager = m_App.Workbench.CommandBarManager; this.isEnabled = false; tbManager.Tools["2dmap.DFEditorTool.Start"].SharedProps.Enabled = false; tbManager.Tools["2dmap.DFEditorTool.Save"].SharedProps.Enabled = true; tbManager.Tools["2dmap.DFEditorTool.Stop"].SharedProps.Enabled = true; tbManager.Tools["2dmap.DFEditorTool.CurrentEditLayerLabel"].SharedProps.Enabled = true; tbManager.Tools["2dmap.DFEditorTool.CurrentEditLayer"].SharedProps.Enabled = true; //tbManager.Tools["2dmap.DFEditorTool.Modi.ConstructGeoObj"].SharedProps.Enabled = true; //tbManager.Tools["2dmap.DFEditorTool.Modi.ConstructGeoObjSelect"].SharedProps.Enabled = true; tbManager.Tools["2dmap.Select.Layer.EditFeature"].SharedProps.Enabled = true; tbManager2dmapeditEnabledOrNot(); //记录用户操作 clsUserLog useLog = new clsUserLog(); useLog.UserName = DFApplication.LoginUser; useLog.UserRoll = DFApplication.LoginSubSys; useLog.Operation = "开始编辑"; useLog.LogTime = System.DateTime.Now; useLog.TableLog = (m_App.CurrentWorkspace as IFeatureWorkspace).OpenTable("WSGRI_LOG"); useLog.setUserLog(); }
public override void Execute() { base.Execute(); if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } m_MapView.CurrentTool = this; m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_pDisplay = m_pActiveView.ScreenDisplay; m_pStatusBarService = m_App.StatusBarService; //获得状态服务 CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.drawTraceLine; m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair; CommonFunction.MapRefresh(m_pActiveView); frmFixLength formFixDist = new frmFixLength(); formFixDist.ShowDialog(); m_pStatusBarService.SetStateMessage("步骤:1.选择要素;2.右键/ENTER/SPACEBAR,结束选择;3.左键,确定跟踪的起点;4.左键,结束跟踪。(ESC: 取消/DEL:删除)"); //记录用户操作 clsUserLog useLog = new clsUserLog(); useLog.UserName = DFApplication.LoginUser; useLog.UserRoll = DFApplication.LoginSubSys; useLog.Operation = "绘制跟踪线"; useLog.LogTime = System.DateTime.Now; useLog.TableLog = (m_App.CurrentWorkspace as IFeatureWorkspace).OpenTable("WSGRI_LOG"); useLog.setUserLog(); }
public void AddMapScaleTOComBox(IDFApplication app) { //填充地图比例尺下拉框列表 UltraToolbarsManager tbManager; tbManager = app.Workbench.CommandBarManager; tbManager.Tools["2dmap.Scale.Label"].SharedProps.Enabled = true; tbManager.Tools["2dmap.Scale"].SharedProps.Enabled = true; ComboBoxTool tbUltraComboConstruct; tbUltraComboConstruct = (ComboBoxTool)tbManager.Tools["2dmap.Scale"]; try { tbUltraComboConstruct.ToolKeyPress -= new ToolKeyPressEventHandler(tbUltraComboConstruct_ToolKeyPress); } catch { } tbUltraComboConstruct.ToolKeyPress += new ToolKeyPressEventHandler(tbUltraComboConstruct_ToolKeyPress); try { int a = 250; int b = 500; int c = 1000; int d = 1500; int e = 2000; int f = 2500; int g = 5000; int h = 10000; tbUltraComboConstruct.ValueList.ValueListItems.Clear(); tbUltraComboConstruct.ValueList.ValueListItems.Add(a, "1:250"); tbUltraComboConstruct.ValueList.ValueListItems.Add(b, "1:500"); tbUltraComboConstruct.ValueList.ValueListItems.Add(c, "1:1,000"); tbUltraComboConstruct.ValueList.ValueListItems.Add(d, "1:1,500"); tbUltraComboConstruct.ValueList.ValueListItems.Add(e, "1:2,000"); tbUltraComboConstruct.ValueList.ValueListItems.Add(f, "1:2,500"); tbUltraComboConstruct.ValueList.ValueListItems.Add(g, "1:5,000"); tbUltraComboConstruct.ValueList.ValueListItems.Add(h, "1:10,000"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public override void Execute() { base.Execute(); if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } m_MapView.CurrentTool = this; m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_CurrentLayer = m_App.CurrentEditLayer; m_pStatusBarService = m_App.StatusBarService; //获得状态服务 CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.drawCircle3P; CommonFunction.MapRefresh(m_pActiveView); m_dblTolerance = CommonFunction.ConvertPixelsToMapUnits(m_MapControl.ActiveView, 4); m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair; m_pStatusBarService.SetStateMessage("提示:依次指定圆周上三点。(A:绝对XY/R:相对XY/P:平行尺/ESC:取消/ENTER:结束/+shift:修改坐标)"); //向状态栏传送提示信息 //记录用户操作 clsUserLog useLog = new clsUserLog(); useLog.UserName = DFApplication.LoginUser; useLog.UserRoll = DFApplication.LoginSubSys; useLog.Operation = "绘制圆形"; useLog.LogTime = System.DateTime.Now; useLog.TableLog = (m_App.CurrentWorkspace as IFeatureWorkspace).OpenTable("WSGRI_LOG"); useLog.setUserLog(); }
public override void Execute() { base.Execute(); if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } m_MapView.CurrentTool = this; m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_CurrentLayer = m_App.CurrentEditLayer; m_pStatusBarService = m_App.StatusBarService; //获得状态服务 CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.drawRectRelative2P; CommonFunction.MapRefresh(m_pActiveView); m_dblTolerance = CommonFunction.ConvertPixelsToMapUnits(m_MapControl.ActiveView, 4); m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair; m_pStatusBarService.SetStateMessage("依次指定:1.对角线上两点;2.宽度。(U:回退/F:长度+方向/D:长度/O:方位角/B:边长/A:绝对XY/R:相对XY/Enter:结束/ESC:取消)"); //记录用户操作 clsUserLog useLog = new clsUserLog(); useLog.UserName = DFApplication.LoginUser; useLog.UserRoll = DFApplication.LoginSubSys; useLog.Operation = "绘制矩形"; useLog.LogTime = System.DateTime.Now; useLog.TableLog = (m_App.CurrentWorkspace as IFeatureWorkspace).OpenTable("WSGRI_LOG"); useLog.setUserLog(); }
public override void Execute() { if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } else { //绑定事件 //m_MapView.CurrentTool = this; } m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_App.CurrentMapControl.ActiveView.FocusMap; SaveEditing(m_FocusMap); m_App.IsModifyWorkSpace = false; tbManager2dmapeditEnabledOrNot(); //记录用户操作 clsUserLog useLog = new clsUserLog(); useLog.UserName = DFApplication.LoginUser; useLog.UserRoll = DFApplication.LoginSubSys; useLog.Operation = "停止编辑"; useLog.LogTime = System.DateTime.Now; useLog.TableLog = (m_App.CurrentWorkspace as ESRI.ArcGIS.Geodatabase.IFeatureWorkspace).OpenTable("WSGRI_LOG"); useLog.setUserLog(); }
public override void Execute() { if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } if (m_App.CurrentConfig.cfgSnapEnvironmentSet.CurrentSnapType != m_strSnapTpye.PartBoundary) { m_App.CurrentConfig.cfgSnapEnvironmentSet.CurrentSnapType = m_strSnapTpye.PartBoundary; m_App.CurrentConfig.cfgSnapEnvironmentSet.IsUseMixSnap = false; } else { m_App.CurrentConfig.cfgSnapEnvironmentSet.CurrentSnapType = null; } }
public override void Execute() { base.Execute(); if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } m_MapView.CurrentTool = this; m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_pStatusBarService = m_App.StatusBarService;//获得状态服务 CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.CalculateDistance; CommonFunction.MapRefresh(m_pActiveView); //记录用户操作 clsUserLog useLog = new clsUserLog(); useLog.UserName = DFApplication.LoginUser; useLog.UserRoll = DFApplication.LoginSubSys; useLog.Operation = "测量距离"; useLog.LogTime = System.DateTime.Now; useLog.TableLog = (m_App.CurrentWorkspace as IFeatureWorkspace).OpenTable("WSGRI_LOG"); useLog.setUserLog(); }
public override void Execute() { if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } Console.WriteLine(m_App.CurrentConfig.cfgSnapEnvironmentSet.CurrentSnapType); if (m_App.CurrentConfig.cfgSnapEnvironmentSet.CurrentSnapType != m_strSnapTpye.Intersection) { m_App.CurrentConfig.cfgSnapEnvironmentSet.CurrentSnapType = m_strSnapTpye.Intersection; m_App.CurrentConfig.cfgSnapEnvironmentSet.IsUseMixSnap = false; } else { m_App.CurrentConfig.cfgSnapEnvironmentSet.CurrentSnapType = null; } }
public override void Execute() { base.Execute(); if (!(this.Hook is IDFApplication)) { return; } else { m_App = (IDFApplication)this.Hook; } m_MapView = m_App.Workbench.GetView(typeof(MapView)) as IMapView; if (m_MapView == null) { return; } //else //{ // //Modify by YuanHY20081112 // m_ToolbarManager = (m_App.Workbench as DefaultWorkbench).commandBarManager; // ToolBase toolBase = m_ToolbarManager.Tools["2dmap.DFEditorTool.DrawArc3P"]; // if (m_MapView.CurrentTool == this) // { // if (((StateButtonTool)toolBase).Checked == false) // { // ((StateButtonTool)toolBase).Checked = true;//按下状态 // return; // } // } //} m_MapView.CurrentTool = this; m_MapControl = m_App.CurrentMapControl; m_FocusMap = m_MapControl.ActiveView.FocusMap; m_pActiveView = (IActiveView)this.m_FocusMap; m_CurrentLayer = m_App.CurrentEditLayer; //获得状态栏的服务 m_pStatusBarService = m_App.StatusBarService; CurrentTool.m_CurrentToolName = CurrentTool.CurrentToolName.drawArc3P; CommonFunction.MapRefresh(m_pActiveView); m_dblTolerance = CommonFunction.ConvertPixelsToMapUnits(m_pActiveView, 4); m_MapControl.MousePointer = esriControlsMousePointer.esriPointerCrosshair; m_pStatusBarService.SetStateMessage("提示:依次指定圆弧上的三点(A:绝对XY/R:相对XY/P:平行尺/ESC:取消/ENTER:结束/+shift:修改坐标)"); //记录用户操作 clsUserLog useLog = new clsUserLog(); useLog.UserName = DFApplication.LoginUser; useLog.UserRoll = DFApplication.LoginSubSys; useLog.Operation = "绘制弧/扇形"; useLog.LogTime = System.DateTime.Now; useLog.TableLog = (m_App.CurrentWorkspace as IFeatureWorkspace).OpenTable("WSGRI_LOG"); useLog.setUserLog(); }