/// <summary> /// 添加数据 /// </summary> //添加图层 public static void AddLayerToGlobe(AxGlobeControl _axGlobeControl) { ICommand pCommand; pCommand = new ControlsAddDataCommandClass(); pCommand.OnCreate(_axGlobeControl.Object); pCommand.OnClick(); }
/// <summary> /// 添加数据 /// </summary> public static void AddData(ESRI.ArcGIS.Controls.AxMapControl axMapControl) { if (axMapControl == null) { return; } ICommand pCommand; pCommand = new ControlsAddDataCommandClass(); pCommand.OnCreate(axMapControl.Object); pCommand.OnClick(); }
//添加数据 private void addToolStripMenuItem_Click(object sender, EventArgs e) { int currentLayerCount = this.axMapControl1.LayerCount; ICommand pCommand = new ControlsAddDataCommandClass(); pCommand.OnCreate(this.axMapControl1.Object); pCommand.OnClick(); IMap pMap = this.axMapControl1.Map; this.m_controlsSynchronizer.ReplaceMap(pMap); }
private void DataAddItem_Click(object sender, EventArgs e) { try { ControlsAddDataCommand addData = new ControlsAddDataCommandClass(); addData.OnCreate(this.axMapcontrol.GetOcx()); addData.OnClick(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonItem9_Click(object sender, EventArgs e) { UID uID = new UIDClass(); uID.Value = "esriControls.ControlsAddDataCommand"; ICommand cmd = this.m_cpool.FindByUID(uID); if (cmd == null) { cmd = new ControlsAddDataCommandClass(); ICommandPoolEdit pool = this.m_cpool as ICommandPoolEdit; pool.AddCommand(cmd, uID); pool.CallOnCreate(cmd); } cmd.OnClick(); }
//添加图层 public static void AddLayerData(ESRI.ArcGIS.Controls.AxMapControl axMapControl) { if (axMapControl == null) { return; } try { ICommand pCommand; pCommand = new ControlsAddDataCommandClass(); pCommand.OnCreate(axMapControl.Object); pCommand.OnClick(); } catch (Exception e) { MessageBox.Show(e.Message); } }
private void Btn_AddData_Click(object sender, EventArgs e) { ICommand pCmd = new ControlsAddDataCommandClass(); switch (Ctrl_Tab.SelectedIndex) { case 0: pCmd.OnCreate(Ctrl_Map.Object); break; case 1: pCmd.OnCreate(Ctrl_PageLayout.Object); break; case 2: pCmd.OnCreate(Ctrl_Scene.Object); break; default: break; } pCmd.OnClick(); }
//导入后时相卫片 private void importPostImg_Click(object sender, EventArgs e) { ICommand command = new ControlsAddDataCommandClass(); command.OnCreate(m_mapControl); command.OnClick(); int newAddedNum = m_mapControl.LayerCount - m_currentLayerNum; if (newAddedNum >= 1) { ILayer pLayer = null; for (int i = 0; i < newAddedNum; i++) { pLayer = m_mapControl.get_Layer(i); pLayer.Name = "后时相卫片" + (m_postImgLayers.Count + 1).ToString(); m_postImgLayers.Add(pLayer); } pLayer = null; this.axTOCControl1.Update(); m_currentLayerNum = m_mapControl.LayerCount; } }
private void 命令方式ToolStripMenuItem_Click(object sender, EventArgs e) { ICommand pAddData = new ControlsAddDataCommandClass(); pAddData.OnCreate(axMapControl1.Object); pAddData.OnClick(); }
void IGMap.AddData() { ICommand command = new ControlsAddDataCommandClass(); command.OnCreate(this._hook); command.OnClick(); }
/// <summary> /// Occurs when this command is clicked /// </summary> public override void OnClick() { ESRI.ArcGIS.Controls.ControlsAddDataCommand cmdAddData = new ControlsAddDataCommandClass(); cmdAddData.OnCreate(m_globeHookHelper.Hook); cmdAddData.OnClick(); }
//打开图层 private void Add_Data_Click(object sender, EventArgs e) { int currentLayerCount = this.axMapControl1.LayerCount; ICommand pCommand = new ControlsAddDataCommandClass(); pCommand.OnCreate(this.axMapControl1.Object); pCommand.OnClick(); }
//导入线状地物 private void importXZDW_Click(object sender, EventArgs e) { if (m_xzdwLayer != null) { DialogResult dr = MessageBox.Show("线状地物图层已加载,是否替换?", "提示", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.No) { return; } else { m_mapControl.Map.DeleteLayer(m_xzdwLayer); m_xzdwLayer = null; m_currentLayerNum = m_mapControl.LayerCount; } } ICommand command = new ControlsAddDataCommandClass(); command.OnCreate(m_mapControl); command.OnClick(); int newAddedNum = m_mapControl.LayerCount - m_currentLayerNum; if (newAddedNum == 0) { MessageBox.Show("未导入线状地物!"); } else if (newAddedNum == 1) { ILayer pLayer = null; for (int i = 0; i < m_mapControl.LayerCount; i++) { pLayer = m_mapControl.get_Layer(i); if (pLayer.Name.ToString().ToUpper().Contains("XZDW")) { pLayer.Name = "线状地物"; m_xzdwLayer = pLayer; break; } } //m_xzdwLayer = m_mapControl.get_Layer(0); //m_xzdwLayer.Name = "线状地物"; m_currentLayerNum = m_mapControl.LayerCount; this.axTOCControl1.Update(); } else if (newAddedNum > 1) { //for (int i = 0; i < newAddedNum; i++) //{ // //m_mapControl.DeleteLayer(m_mapControl.LayerCount - i - 1); // m_mapControl.DeleteLayer(0);//循环删除最上层就好了 //} ILayer pLayer = null; int lyrcount = m_mapControl.LayerCount; for (int i = lyrcount - 1; i < 0; i--) { pLayer = m_mapControl.get_Layer(i); if (pLayer.Name.ToString().ToUpper().Contains("XZDW")) { m_mapControl.DeleteLayer(i); } } MessageBox.Show("线状地物只能导入一层!请重新导入!"); } else { MessageBox.Show("线状地物导入失败!请重新导入!"); return; } }
private void btnAddData_Click(object sender, EventArgs e) { int currentLayerCount = this.mainMapControl.LayerCount; ICommand pCommand = new ControlsAddDataCommandClass(); pCommand.OnCreate(this.mainMapControl.Object); pCommand.OnClick(); IMap pMap = this.mainMapControl.Map; this.m_controlsSynchronizer.ReplaceMap(pMap); if (this.mainMapControl.LayerCount > currentLayerCount) { this.EagleaxMapControl.AddLayer(this.mainMapControl.get_Layer(0)); this.EagleaxMapControl.Extent = this.EagleaxMapControl.FullExtent; this.EagleaxMapControl.Refresh(); } }