Ejemplo n.º 1
0
        void Add_HM_Panel()
        {
            // Add a dockable panel
            hydroModelerControl = new mainTab(App, rps_dict, ((TextEntryActionItem)rps_dict["dirbox"]).Text);
            var hmDockPanel = new DockablePanel(kHydroModelerDock, _pluginName, hydroModelerControl, DockStyle.Fill);

            hmDockPanel.DefaultSortOrder = 1000; //HydroModeler should be the last dockable panel by default
            App.DockManager.Add(hmDockPanel);

            // set the initial text for the dirbox
            try
            {
                Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
                string start_path = Path.GetFullPath(HydroModeler.Properties.Resources.startpath);
                if (Directory.Exists(start_path))
                {
                    ((TextEntryActionItem)rps_dict["dirbox"]).Text = start_path;
                }
                else
                {
                    ((TextEntryActionItem)rps_dict["dirbox"]).Text = "C:\\";
                }
            }
            catch
            {
                ((TextEntryActionItem)rps_dict["dirbox"]).Text = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins\\HydroModeler\\"); //C:\\";
            }

            // update filelist
            string text = ((TextEntryActionItem)rps_dict["dirbox"]).Text;

            hydroModelerControl.filelist_update(text);

            // set pan mouse image
            hydroModelerControl.Image_Path = ImagePath;

            // add event for when HM panel is selected
            App.DockManager.ActivePanelChanged += new EventHandler <DotSpatial.Controls.Docking.DockablePanelEventArgs>(HM_Panel_Selected);

            App.HeaderControl.RootItemSelected += new EventHandler <RootItemEventArgs>(HeaderControl_RootItemSelected);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new instance of <see cref="RunBox">RunBox</see> dialog.
 /// </summary>
 public RunBox(mainTab instance)
 {
     hydroModelerControl = instance;
     InitializeComponent();
 }