Ejemplo n.º 1
0
        // Methods
        public DockPanel Add(ref UIDockPanel newPanel, DockingStyle dockStyle)
        {
            if (dockStyle == DockingStyle.Fill)
            {
                dockStyle = DockingStyle.Right;
            }
            if (this._panelSet.Contains(newPanel))
            {
                int index = this._panelSet.IndexOf(newPanel);
                newPanel                     = this._panelSet[index];
                newPanel.Panel.Dock          = dockStyle;
                newPanel.Panel.FloatSize     = new Size(newPanel.Width, newPanel.Height);
                newPanel.Panel.FloatLocation = newPanel.Location;
                if (newPanel.Panel.Visibility == DockVisibility.AutoHide)
                {
                    newPanel.Panel.Close();
                }
                if (newPanel.Panel.Visibility != DockVisibility.Visible)
                {
                    newPanel.Panel.Visibility = DockVisibility.AutoHide;
                    newPanel.Panel.ShowSliding();
                }
                return(newPanel.Panel);
            }
            DockPanel panel = DFApplication.Application.Workbench.AddPanel(dockStyle);

            panel.DockedAsTabbedDocument            = false;
            panel.Options.AllowDockAsTabbedDocument = false;
            panel.Text = newPanel.PanelName;
            int width = 0;

            if (newPanel.Width < 30)
            {
                width = this._defaultWidth;
            }
            else
            {
                width = newPanel.Width;
            }
            int height = 0;

            if (newPanel.Height < 100)
            {
                height = this._defaultHeight;
            }
            else
            {
                height = newPanel.Height;
            }
            panel.FloatSize     = new Size(width, height);
            panel.FloatLocation = newPanel.Location;
            if (this._tabPanel == null)
            {
                this._tabPanel = panel;
            }
            panel.Visibility = DockVisibility.AutoHide;
            panel.ShowSliding();
            newPanel.Panel = panel;
            this._panelSet.Add(newPanel);
            return(panel);
        }
Ejemplo n.º 2
0
 public void RemovePanel(UIDockPanel fpanel)
 {
     fpanel.Panel.Focus();
     fpanel.Panel.Visibility = DockVisibility.Hidden;
     DFApplication.Application.Workbench.Refresh();
 }