private void InitialbarMap() { Plugin.Interface.IToolRef tool = null; Plugin.Interface.ICommandRef cmd = null; Plugin.Application.IAppArcGISRef appArcGISRef = new Plugin.Application.AppGIS(); appArcGISRef.MapControl = axMapControl.Object as IMapControlDefault;; v_dicCommands = new Dictionary <string, Plugin.Interface.ICommandRef>(); v_dicTools = new Dictionary <string, Plugin.Interface.IToolRef>(); tool = new GeoUtilities.ControlsDefaultTool(); tool.OnCreate(appArcGISRef); v_dicTools.Add("btnDefault", tool); tool = new GeoUtilities.ControlsMapZoomInTool(); tool.OnCreate(appArcGISRef); v_dicTools.Add("btnMapZoomIn", tool); tool = new GeoUtilities.ControlsMapZoomOutTool(); tool.OnCreate(appArcGISRef); v_dicTools.Add("btnMapZoomOut", tool); tool = new GeoUtilities.ControlsMapPanTool(); tool.OnCreate(appArcGISRef); v_dicTools.Add("btnMapPan", tool); cmd = new GeoUtilities.ControlsMapZoomInFixedCommand(); cmd.OnCreate(appArcGISRef); v_dicCommands.Add("btnMapZoomInFixed", cmd); cmd = new GeoUtilities.ControlsMapZoomOutFixedCommand(); cmd.OnCreate(appArcGISRef); v_dicCommands.Add("btnMapZoomOutFixed", cmd); cmd = new GeoUtilities.ControlsMapRefreshViewCommand(); cmd.OnCreate(appArcGISRef); v_dicCommands.Add("btnMapRefreshView", cmd); cmd = new GeoUtilities.ControlsMapFullExtentCommand(); cmd.OnCreate(appArcGISRef); v_dicCommands.Add("btnMapFullExtent", cmd); cmd = new GeoUtilities.ControlsMapZoomToLastExtentBackCommand(); cmd.OnCreate(appArcGISRef); v_dicCommands.Add("btnMapZoomToLastExtentBack", cmd); cmd = new GeoUtilities.ControlsMapZoomToLastExtentForwardCommand(); cmd.OnCreate(appArcGISRef); v_dicCommands.Add("btnMapZoomToLastExtentForward", cmd); tool = new GeoUtilities.ControlsMapIdentifyTool(); tool.OnCreate(appArcGISRef); v_dicTools.Add("btnMapIdentify", tool); tool = new GeoUtilities.ControlsMapMeasureTool(); tool.OnCreate(appArcGISRef); v_dicTools.Add("btnMapMeasure", tool); }
private void barMap_ItemClick(object sender, EventArgs e) { DevComponents.DotNetBar.ButtonItem aButtonItem = sender as DevComponents.DotNetBar.ButtonItem; if (aButtonItem == null) { return; } if (v_dicCommands.ContainsKey(aButtonItem.Name)) { Plugin.Interface.ICommandRef pCommandRef = v_dicCommands[aButtonItem.Name] as Plugin.Interface.ICommandRef; pCommandRef.OnClick(); } if (v_dicTools.ContainsKey(aButtonItem.Name)) { Plugin.Interface.IToolRef pToolRef = v_dicTools[aButtonItem.Name] as Plugin.Interface.IToolRef; pToolRef.OnClick(); } }