Ejemplo n.º 1
0
        public void Remove(IDockPanelView view, PluginIdentity identity)
        {
            if (view == null)
            {
                throw new ArgumentException("panel");
            }

            if (!_dict.ContainsValue(view))
            {
                throw new ApplicationException("Dock panel isn't registed in the collection");
            }

            _dict.Remove(new DockPanelInfo(identity, view.DockName));

            _dockingManager.RemovePanel(_dockingManager.Panels[view.DockName]);
        }
Ejemplo n.º 2
0
 public void SetDockVisible(string dockName, bool isVisible, bool isActive)
 {
     DevExpress.XtraBars.Docking.DockPanel panel = _dockingManager.Panels[dockName];
     if (panel == null)
     {
         if (isVisible == true)
         {
             IDockPanelView view = _dict.FirstOrDefault(c => c.Key.Key == dockName).Value;
             DockTo("", view);
         }
         return;
     }
     panel.Visible = isVisible;
     if (isVisible == true && isActive)
     {
         _dockingManager.ActivePanel = panel;
     }
 }
Ejemplo n.º 3
0
        private DockPanel DockTo(string parentName, IDockPanelView view)
        {
            DevExpress.XtraBars.Docking.DockPanel parentPanel;
            if (string.IsNullOrEmpty(parentName))
            {
                parentPanel = null;
            }
            else
            {
                parentPanel = _dockingManager.Panels[parentName];

                if (parentPanel != null && parentPanel.Visibility == DockVisibility.Hidden)
                {
                    parentPanel = null;
                }
            }
            DevExpress.XtraBars.Docking.DockingStyle style = DockHelper.MapWindowToDevExpress(view.DefaultDock);
            if (style == DockingStyle.Fill)
            {
                style = DockingStyle.Float;
            }

            DevExpress.XtraBars.Docking.DockPanel panel = null;
            if (parentPanel == null)
            {
                panel = _dockingManager.AddPanel(style);
            }
            else
            {
                panel = parentPanel.AddPanel();
            }
            panel.Name   = view.DockName;
            panel.Header = view.Caption;
            panel.Image  = view.Image;
            //panel.Dock = DockHelper.MapWindowToDevExpress(((IDockPanelView)_control).DefaultDock);
            panel.FloatSize      = view.DefaultSize;
            ((Control)view).Dock = DockStyle.Fill;
            panel.TabText        = view.Caption;
            panel.Text           = view.Caption;
            panel.Controls.Add((Control)view);
            return(panel);
        }
Ejemplo n.º 4
0
        public DockPanel Add(IDockPanelView view, PluginIdentity identity)
        {
            if (view == null)
            {
                throw new NullReferenceException();
            }

            if (string.IsNullOrWhiteSpace(view.DockName))
            {
                throw new ApplicationException("Dock panel must have a unique key.");
            }

            if (_dict.ContainsValue(view))
            {
                throw new ApplicationException("This control has been already added as a docking window.");
            }

            //_dockingManager.SetEnableDocking(control, true);

            _dict.Add(new DockPanelInfo(identity, view.DockName), view);

            return(LoadDockPanel(view));
        }
Ejemplo n.º 5
0
 private DockPanel LoadDockPanel(IDockPanelView view)
 {
     return(DockTo(view.DefaultNestDockName, view));
 }