예제 #1
0
        public override void Activate()
        {
            // todo: export Shell in MapWindow as Form to avoid type casting
            if (Shell is Form)
            {
                ((Form)Shell).FormClosing += MainForm_FormClosing;
            }

            // Add panel to the docking manager
            if (_seriesSelector != null)
            {
                _hydroRControl = new cRCommandView(_seriesSelector);

                AddHydroRPanel();

                AddHydroRRibbon();



                //when the HydroR panel is selected - activate SeriesView and HydroR ribbon tab
                App.DockManager.ActivePanelChanged += new EventHandler <DotSpatial.Controls.Docking.DockablePanelEventArgs>(DockManager_ActivePanelChanged);

                App.DockManager.SelectPanel("kHydroSeriesView");
                App.HeaderControl.SelectRoot(kHydroR);

                _hydroRControl.RChanged += new cRCommandView.REventHandler(_hydroRControl_RChanged);

                //when the HydroR root item is selected
                App.HeaderControl.RootItemSelected += new EventHandler <RootItemEventArgs>(HeaderControl_RootItemSelected);
            }

            base.Activate();
        }
예제 #2
0
        /// <summary>
        /// Initialize the mapWindow 6 plugin
        /// </summary>
        /// <param name="args">The plugin arguments to access the main application</param>
        public void Initialize(IMapPluginArgs args)
        {
            //set the reference to the MapWindow application
            _mapArgs = args;

            string tabPageName = "HydroR";

            _mainTabControl = FindMainTabControl();



            //add some items to the newly created tab control
            if (_mainTabControl != null)
            {
                _hydroRTabPage = new TabPage(tabPageName);
                _mainTabControl.TabPages.Add(_hydroRTabPage);

                //add the cRCommandView control to the main tab page
                _hydroRControl = new cRCommandView();
                _hydroRTabPage.Controls.Add(_hydroRControl);
                _hydroRControl.Dock = DockStyle.Fill;
                _mainTabControl.SelectedIndexChanged += new EventHandler(mainTabControl_SelectedIndexChanged);
            }
        }