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]); }
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; } }
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); }
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)); }
private DockPanel LoadDockPanel(IDockPanelView view) { return(DockTo(view.DefaultNestDockName, view)); }