private object RequestResponder(OperationType type, object param = null) { switch (type) { case OperationType.SentStyleGalleryItem: m_pStyleGalleryItem = param as IStyleGalleryItem; return(null); case OperationType.GetViewIndex: return(Ctrl_Tab.SelectedIndex); case OperationType.GetSelectedLayer: return(m_selectedLayer); case OperationType.RefreshMapCtrl: Ctrl_Map.Refresh(); return(null); case OperationType.UpdateTOCCtrl: Ctrl_TOC.Update(); return(null); case OperationType.ClearSelection: Ctrl_Map.Map.ClearSelection(); return(null); case OperationType.ModifyExtent: Ctrl_Map.Extent = param as IEnvelope; return(null); case OperationType.GetMap: return(Ctrl_Map.Map); case OperationType.GetScene: return(Ctrl_Scene.Scene); case OperationType.ZoomToSelection: ICommand curCmd = new ControlsZoomToSelectedCommandClass(); curCmd.OnCreate(Ctrl_Map.Object); curCmd.OnClick(); return(null); case OperationType.FormAttributeHighLightRow: if (m_FrmAttribute != null) { m_FrmAttribute.HightLightSelection(); } return(null); default: return(null); } }
private void Ctrl_TOC_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e) { esriTOCControlItem itemType = esriTOCControlItem.esriTOCControlItemNone; IBasicMap pMap = null; object unk = null; object data = null; ILayer pLayer = null; Ctrl_TOC.HitTest(e.x, e.y, ref itemType, ref pMap, ref pLayer, ref unk, ref data); m_selectedLayer = pLayer as ILayer; if (itemType != esriTOCControlItem.esriTOCControlItemLayer) { return; } switch (Ctrl_Tab.SelectedIndex) { case 0: if (e.button == 2) { Ctrl_MapTOCCMS.Show(Control.MousePosition); } break; case 1: if (e.button == 2) { Ctrl_MapTOCCMS.Show(Control.MousePosition); } break; case 2: if (e.button == 2) { Ctrl_SceneTOCCMS.Show(Control.MousePosition); } break; default: break; } }
private void Ctrl_Tab_SelectedIndexChanged(object sender, EventArgs e) { UID uID = new UIDClass(); switch (Ctrl_Tab.SelectedIndex) { case 0: Ctrl_TOC.SetBuddyControl(Ctrl_Map.Object); Ctrl_Toolbar.SetBuddyControl(Ctrl_Map.Object); Ctrl_Toolbar.RemoveAll(); uID.Value = "esriControls.ControlsOpenDocCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsAddDataCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsMapZoomInTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, true, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsMapZoomOutTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsMapPanTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsMapFullExtentCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsSelectFeaturesTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, true, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsNetworkAnalystWindowCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, true, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsNetworkAnalystCreateLocationTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsNetworkAnalystSelectLocationTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsNetworkAnalystRouteCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsNetworkAnalystSolveCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); break; case 1: Ctrl_TOC.SetBuddyControl(Ctrl_PageLayout.Object); Ctrl_Toolbar.SetBuddyControl(Ctrl_PageLayout.Object); Ctrl_Toolbar.RemoveAll(); uID.Value = "esriControls.ControlsAddDataCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsPageZoomInTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, true, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsPageZoomOutTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsPagePanTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsPageZoomWholePageCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); break; case 2: Ctrl_TOC.SetBuddyControl(Ctrl_Scene.Object); Ctrl_Toolbar.SetBuddyControl(Ctrl_Scene.Object); Ctrl_Toolbar.RemoveAll(); uID.Value = "esriControls.ControlsSceneZoomInTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsSceneZoomOutTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsScenePanTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsSceneFullExtentCommand"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); uID.Value = "esriControls.ControlsSceneNavigateTool"; Ctrl_Toolbar.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText); break; default: break; } }