private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DockPanelCollection hpColl = this.dm.HiddenPanels; for (int i = 0; i < hpColl.Count; i++) { DockPanel dp = hpColl[i]; string floatPanels = dp.Text; } }
/// <summary> /// Sets all the necessary references from the main view. /// </summary> /// <remarks>We don't use contructor injection here since most of other services use this one as a parameter. /// Perhaps property injection can be used.</remarks> internal void Init( IMainView mainView, IProjectService project, IConfigService configService ) { Logger.Current.Trace("Start AppContext.Init()"); if (mainView == null) { throw new ArgumentNullException("mainView"); } if (project == null) { throw new ArgumentNullException("project"); } // it's expected here that we are on the UI thread SynchronizationContext = SynchronizationContext.Current; PluginManager = _container.GetSingleton <IPluginManager>(); Broadcaster = _container.GetSingleton <IBroadcasterService>(); _mainView = mainView; View = new AppView(mainView, _styleService); _project = project; _configService = configService; DockPanels = new DockPanelCollection(mainView.DockingManager, mainView as Form, Broadcaster, _styleService); //创建Ribbon主菜单 RibbonMenu = MenuFactory.CreateRibbonMenu(mainView.RibbonControlAdv); StatusBar = MenuFactory.CreateStatusBar(mainView.StatusBar, PluginIdentity.Default); this.InitDocking(); Initialized = true; Logger.Current.Trace("End AppContext.Init()"); }
/// <summary> /// Sets all the necessary references from the main view. /// </summary> /// <remarks>We don't use contructor injection here since most of other services use this one as a parameter. /// Perhaps property injection can be used.</remarks> internal void Init( IMainView mainView, IProjectService project, IConfigService configService, LegendPresenter legendPresenter, ToolboxPresenter toolboxPresenter, IRepository repository) { Logger.Current.Trace("Start AppContext.Init()"); if (mainView == null) { throw new ArgumentNullException("mainView"); } if (project == null) { throw new ArgumentNullException("project"); } if (legendPresenter == null) { throw new ArgumentNullException("legendPresenter"); } if (toolboxPresenter == null) { throw new ArgumentNullException("toolboxPresenter"); } _toolboxPresenter = toolboxPresenter; _legendPresenter = legendPresenter; var legend = _legendPresenter.Legend; mainView.Map.Legend = legend; legend.Map = mainView.Map; // it's expected here that we are on the UI thread SynchronizationContext = SynchronizationContext.Current; PluginManager = _container.GetSingleton <IPluginManager>(); Broadcaster = _container.GetSingleton <IBroadcasterService>(); _container.RegisterInstance <IMuteMap>(mainView.Map); _mainView = mainView; View = new AppView(mainView, _styleService); _project = project; _map = mainView.Map; _configService = configService; Repository = repository; Legend.Lock(); DockPanels = new DockPanelCollection(mainView.DockingManager, mainView as Form, Broadcaster, _styleService); Menu = MenuFactory.CreateMainMenu(mainView.MenuManager); Toolbars = MenuFactory.CreateMainToolbars(mainView.MenuManager); StatusBar = MenuFactory.CreateStatusBar(mainView.StatusBar, PluginIdentity.Default); _projectionDatabase.ReadFromExecutablePath(Application.ExecutablePath); Repository.Initialize(this); // comment this line to prevent locator loading // may be useful for ocx debugging to not create additional // instance of map _locator = new LocatorPresenter(_map); this.InitDocking(); Initialized = true; Logger.Current.Trace("End AppContext.Init()"); }
/// <summary> /// Sets all the necessary references from the main view. /// </summary> /// <remarks>We don't use contructor injection here since most of other services use this one as a parameter. /// Perhaps property injection can be used.</remarks> internal void Init( IMainView mainView, IProjectService project, IConfigService configService, MapLegendPresenter mapLegendPresenter, OverviewPresenter overviewPresenter ) { Logger.Current.Trace("Start AppContext.Init()"); if (mainView == null) { throw new ArgumentNullException("mainView"); } if (project == null) { throw new ArgumentNullException("project"); } if (mapLegendPresenter == null) { throw new ArgumentNullException("legendPresenter"); } //初始化图例控件 _mapLegendPresenter = mapLegendPresenter; var legend = _mapLegendPresenter.LegendControl; legend.LegendControl.SetBuddyControl(mainView.MapControl); // it's expected here that we are on the UI thread SynchronizationContext = SynchronizationContext.Current; PluginManager = Container.GetSingleton <IPluginManager>(); Broadcaster = Container.GetSingleton <IBroadcasterService>(); Container.RegisterInstance <IMapControl2>(mainView.MapControl); MainView = mainView; View = new AppView(mainView, _styleService); _project = project; _configService = configService; MainView.AddFrameworkControl(legend.LegendControl.Object); _overviewPresenter = overviewPresenter; _overviewPresenter.SetBuddyControl(mainView.MapControl); MainView.AddFrameworkControl(_overviewPresenter.OverviewControl); // _map = mainView.Map; // // Repository = repository; // Legend.Lock(); DockPanels = new DockPanelCollection(mainView.DockingManager, mainView as Form, Broadcaster, _styleService); //Menu到最后丢弃不用,Menu部分全部采用Ribbon RibbonMenu = RibbonFactory.InitMenus((RibbonControl)mainView.RibbonManager, mainView.RibbonStatusBar as RibbonStatusBar); // Menu = MenuFactory.CreateMainMenu(mainView.RibbonManager,true); // Toolbars = MenuFactory.CreateMainToolbars(mainView.MenuManager); // StatusBar = MenuFactory.CreateStatusBar(mainView.RibbonStatusBar, PluginIdentity.Default); // _projectionDatabase.ReadFromExecutablePath(Application.ExecutablePath); // Repository.Initialize(this); // comment this line to prevent locator loading // may be useful for ocx debugging to not create additional // instance of map // _locator = new LocatorPresenter(_map); this.InitDocking(); //YTHookHelper设置 OperationStack = new OperationStackClass(); m_pStyleGallery = null; //Catalog配置 GxCatalog = new GxCatalog(); //GxSelection=new GxSelection(); //if (this._gxSelection is IGxSelectionEvents) //{ // (this._gxSelection as IGxSelectionEvents).OnSelectionChanged += new OnSelectionChangedEventHandler(this.GxSelection_Changed); //} Initialized = true; Logger.Current.Trace("End AppContext.Init()"); //为了减少修改,给ApplicationRef赋值 ApplicationRef.AppContext = this; }