public CmdRemoveLayer(ITOCControlDefault tocCtl, Bar bar, DataTable table) { // // TODO: Define values for the public properties // base.m_category = "CustomCE"; //localizable text base.m_caption = "ÒƳýͼ²ã"; //localizable text base.m_message = "ÒƳýͼ²ã"; //localizable text base.m_toolTip = "ÒƳýͼ²ã"; //localizable text base.m_name = "CustomCE.CmdRemoveLayer"; //unique id, non-localizable (e.g. "MyCategory_MyCommand") m_pTocCtl = tocCtl; m_pBar = bar; m_pDataTable = table; try { // // TODO: change bitmap name if necessary // string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap"); } }
public CmdChDataSource(IMapControl2 mapctrl, ITOCControlDefault tocCtl) { // // TODO: Define values for the public properties // base.m_category = "CustomCE"; //localizable text base.m_caption = "更改数据源"; //localizable text base.m_message = "更改数据源"; //localizable text base.m_toolTip = "更改数据源"; //localizable text base.m_name = "CustomCE.CmdChDataSource"; //unique id, non-localizable (e.g. "MyCategory_MyCommand") m_HidenMapCtrl = mapctrl; m_pTocCtl = tocCtl; try { // // TODO: change bitmap name if necessary // string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap"); } }
public SymbolizationByLayerPropPage(MyPluginEngine.IApplication hook) { InitializeComponent(); //禁用Glass主题 this.EnableGlass = false; //不显示最大化最小化按钮 this.MaximizeBox = false; this.MinimizeBox = false; // this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; //去除图标 this.ShowIcon = false; m_activeView = hook.MapControl.ActiveView; m_map = hook.MapControl.Map; m_mapControl = hook.MapControl; m_TOCControl = hook.TOCControl; //if (m_hookHelper.Hook is IToolbarControl) //{ // IToolbarControl toolbarControl = m_hookHelper.Hook as IToolbarControl; // m_mapControl = (IMapControl3)toolbarControl.Buddy; //} //if (m_hookHelper.Hook is IMapControl3) //{ // m_mapControl = m_hookHelper.Hook as IMapControl3; //} }
public static void GetSelectedMapAndLayer(ITOCControlDefault tocControl, ref IBasicMap map, ref ILayer layer) { Object other = null; Object index = null; esriTOCControlItem item = esriTOCControlItem.esriTOCControlItemNone; tocControl.GetSelectedItem(ref item, ref map, ref layer, ref other, ref index); }
/// <summary> /// 构造函数 /// </summary> public MainPage() { this.Presenter = new MainPagePresenters(this); InitializeComponent(); try { //初始化IMapControlDefault与IPageLayoutControlDefault接口变量 m_mapControl = axMapControl1.Object as IMapControlDefault; m_pageLayoutControl = axPageLayoutControl1.Object as IPageLayoutControlDefault; m_tocControl = axTOCControl1.Object as ITOCControlDefault; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public FormMain() { InitializeComponent(); try { //初始化IMapControlDefault与IPageLayoutControlDefault接口变量 m_mapControl = axMapControl1.Object as IMapControlDefault; m_pageLayoutControl = axPageLayoutControl1.Object as IPageLayoutControlDefault; m_tocControl = axTOCControl1.Object as ITOCControlDefault; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public DotDensitySymbols(MyPluginEngine.IApplication hook) { InitializeComponent(); //禁用Glass主题 this.EnableGlass = false; //不显示最大化最小化按钮 this.MaximizeBox = false; this.MinimizeBox = false; // this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; //去除图标 this.ShowIcon = false; m_activeView = hook.MapControl.ActiveView; m_map = hook.MapControl.Map; m_TOCControl = hook.TOCControl; }
public ControlHistoryBar(AxMapControl arcGisMapControl, ITOCControlDefault tocControl, DevComponents.AdvTree.AdvTree pProTree, DevComponents.DotNetBar.Bar barHistory, DevComponents.DotNetBar.DotNetBarManager dotNetBarManager) { InitializeComponent(); InitialFrm(); ArcGisMapControl = arcGisMapControl; Mapcontrol = ArcGisMapControl.Object as IMapControlDefault; m_ProTree = pProTree;//cyf 20110705 add if (m_ProTree == null) { return; //cyf 20110705 add } Toccontrol = tocControl; BarHistoryDataCompare = barHistory; MainDotNetBarManager = dotNetBarManager; _map = Mapcontrol.Map; ((IActiveViewEvents_Event)_map).ItemDeleted += new IActiveViewEvents_ItemDeletedEventHandler(LayerControl_ItemDeleted); }
public fm_RasterRenderClassification(MyPluginEngine.IApplication hook) { InitializeComponent(); //禁用Glass主题 this.EnableGlass = false; //不显示最大化最小化按钮 this.MaximizeBox = false; this.MinimizeBox = false; // this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; //去除图标 this.ShowIcon = false; m_map = hook.MapControl.Map; axtoccontrol = hook.TOCControl; axmapcontrol = hook.MapControl; }
public SingleSymbol(IApplication hook) { InitializeComponent(); //禁用Glass主题 this.EnableGlass = false; //不显示最大化最小化按钮 this.MaximizeBox = false; this.MinimizeBox = false; // this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; //去除图标 this.ShowIcon = false; //m_hookHelper = hookHelper; m_activeView = hook.MapControl.ActiveView; m_map = hook.MapControl.Map; m_TOCControl = hook.TOCControl; }
private void frmMain_Load(object sender, EventArgs e) { m_MapControl = (IMapControlDefault)axMapControl1.Object; m_pagelayoutcontrol = (IPageLayoutControlDefault)axPageLayoutControl1.Object; m_toccontrol = (ITOCControlDefault)axTOCControl1.Object; m_controlsSynchronizer = new ControlsSynchronizer(m_MapControl, m_pagelayoutcontrol); m_controlsSynchronizer.BindControls(true); m_controlsSynchronizer.AddFrameworkControl(axTOCControl1.Object); if (!File.Exists(LayoutConfigName)) { dotNetBarManager1.SaveLayout(LayoutConfigName); } dotNetBarManager1.LoadLayout(LayoutConfigName); m_REcentFelesList = new RecnetFilesList(); m_REcentFelesList.ReadRegistryKey(); if (RecnetFilesList.arrRencentFilesList.Count != 0) { SetRecentFilesListMenuItem(); } else { meunItem_Recent.Enabled = false; } TOCControlContextMenu(); DisableControlInEditorToolBar(); }
public CmdZoomToLayer(ITOCControlDefault tocCtl) { // // TODO: Define values for the public properties // base.m_category = "LibEngineCmd"; //localizable text base.m_caption = "кУ╥ежам╪╡Ц"; //localizable text base.m_message = "кУ╥ежам╪╡Ц"; //localizable text base.m_toolTip = "кУ╥ежам╪╡Ц"; //localizable text base.m_name = "CustomCE.CmdZoomToLayer"; //unique id, non-localizable (e.g. "MyCategory_MyCommand") m_pTocCtl = tocCtl; try { // // TODO: change bitmap name if necessary // string bitmapResourceName = GetType().Name + ".bmp"; base.m_bitmap = new Bitmap(GetType(), bitmapResourceName); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap"); } }
public TOCControlContextMenu(ITOCControlDefault tocControl, IMapControlDefault mapControl) { m_TOCControl = tocControl; m_MapControl = mapControl; AddItemToContextMenu(); }
private IToolbarMenu _menuLayer = null; //�һ�Layer #endregion Fields #region Methods public void axTOCControl_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e,AxMapControl pAxMapControl) { pTocControlDef = ((AxTOCControl)sender).Object as ITOCControlDefault; esriTOCControlItem item = esriTOCControlItem.esriTOCControlItemNone; IBasicMap map = null; ILayer layer = null; object other = null; object index = null; pTocControlDef.HitTest(e.x, e.y, ref item, ref map, ref layer, ref other, ref index); //ȷ������Ŀ��ѡ�� if (item == esriTOCControlItem.esriTOCControlItemMap) pTocControlDef.SelectItem(map, null); else pTocControlDef.SelectItem(layer, null); //������Ҽ����,�����˵� if (e.button == 2) { //ѡ�����Map if (item == esriTOCControlItem.esriTOCControlItemMap) { _mapMenu = new ToolbarMenuClass(); _mapMenu.AddItem(new MapMenu(), 1, 0, false, esriCommandStyles.esriCommandStyleTextOnly); _mapMenu.AddItem(new MapMenu(), 2, 1, false, esriCommandStyles.esriCommandStyleTextOnly); _mapMenu.SetHook(pAxMapControl); _mapMenu.PopupMenu(e.x, e.y, pTocControlDef.hWnd); } else if (item == esriTOCControlItem.esriTOCControlItemLayer) //ѡ����� Layer { _menuLayer = new ToolbarMenuClass(); _menuLayer.AddItem(new RemoveLayer(), -1, 0, false, esriCommandStyles.esriCommandStyleTextOnly); _menuLayer.AddItem(new ScaleThresholds(), 1, 1, true, esriCommandStyles.esriCommandStyleTextOnly); _menuLayer.AddItem(new ScaleThresholds(), 2, 2, false, esriCommandStyles.esriCommandStyleTextOnly); _menuLayer.AddItem(new ScaleThresholds(), 3, 3, false, esriCommandStyles.esriCommandStyleTextOnly); _menuLayer.AddItem(new LayerSelectable(), 1, 4, true, esriCommandStyles.esriCommandStyleTextOnly); _menuLayer.AddItem(new LayerSelectable(), 2, 5, false, esriCommandStyles.esriCommandStyleTextOnly); _menuLayer.AddItem(new ZoomToLayer(), -1, 6, true, esriCommandStyles.esriCommandStyleTextOnly); _menuLayer.AddItem(new OpenAttributeTable(), -1, 0, false, esriCommandStyles.esriCommandStyleTextOnly); //_menuLayer.AddItem(new LayerProperty(), -1, 0, false, esriCommandStyles.esriCommandStyleTextOnly); //Set the hook of each menu pTocControlDef.SelectItem(layer, null); _menuLayer.SetHook(pAxMapControl); //Set the layer into the CustomProperty (this is used by the custom layer commands) pAxMapControl.CustomProperty = layer; //�����˵� _menuLayer.PopupMenu(e.x, e.y, pTocControlDef.hWnd); } } if (e.button == 1) { if (item == esriTOCControlItem.esriTOCControlItemLayer) { if (layer is IAnnotationSublayer) return; else { //pmovelayer = layer; } } } }
private IWorkspace m_workSpace = null; //空间数据库的工作空间 #endregion Fields #region Constructors public frmMain() { InitializeComponent(); m_currentWin = this; //初始化地图控件对象 m_mapControl = this.mapCtlMain.Object as IMapControlDefault; m_pageLayoutControl = this.axPageLayoutControl1.Object as IPageLayoutControlDefault; m_tocControl = this.axTOCControl1.Object as ITOCControlDefault; m_sceneControl = this.axSceneControl1.Object as ISceneControlDefault; m_pageLayoutControl.ActiveView.ShowScrollBars = true; m_pageLayoutControl.ActiveView.ShowRulers = true; PageLayoutToolBarInit(); //PageLayout右键菜单 //同步类,使mapcontrol和pagelayoutcontrol中的数据保持一致 m_controlsSynchronizer = new ControlsSynchronizer(m_mapControl, m_pageLayoutControl); m_controlsSynchronizer.BindControls(true); m_controlsSynchronizer.AddFrameWorkControl(this.axTOCControl1.Object); //绑定地图控件 this.axTOCControl1.SetBuddyControl(this.mapCtlMain); m_fgdbPath = ConfigurationManager.AppSettings["FGDBPath"]; //连接数据库,返回工作空间 m_gcon = new GDBConenction(this.m_fgdbPath); m_workSpace = m_gcon.OpenSDEWorkspace(); m_SDEClick = false; m_gdata = new GDBData(m_workSpace); //获取关系数据库连接字符串 m_connectionString = ConfigurationManager.AppSettings["ConnectionString"]; //获取主界面进度条 m_statusBar = this.uiStatusBar1; //初始化工具类 m_toolLib = new ToolLib(m_currentWin); m_toolLib.CurrentControl = "map";//默认mapcontrol为出示当前控件 //打开关系数据库 m_oraConn = new OleDbConnection(m_connectionString); try { m_oraConn.Open(); m_oraCmd = m_oraConn.CreateCommand(); } catch(Exception ee) { MessageBox.Show(ee.Message); } }
public ChangeOrderOfLayersInTOCC(IMapControlDefault pmapControl, ITOCControlDefault ptocControl) { m_MapControl = pmapControl; m_TOCControl = ptocControl; }