internal static void UnRegisterContainer(DockContainer cont) { if (contList.Contains(cont)) { dragEvent = (DockEventHandler)Delegate.Remove(dragEvent, cont.dragWindowHandler); contList.Remove(cont); } }
internal static void UnRegisterContainer(DockContainer cont) { if (!contList.Contains(cont)) { return; } dragEvent -= cont.dragWindowHandler; contList.Remove(cont); }
internal static void RegisterContainer(DockContainer cont) { if (!contList.Contains(cont)) { if (cont == null) { throw new ArgumentNullException("The container must not be null."); } cont.Disposed += new EventHandler(DockManager.ObjectDisposed); contList.Add(cont); dragEvent = (DockEventHandler)Delegate.Combine(dragEvent, cont.dragWindowHandler); } }
/// <summary> /// Initializes the <seealso cref="DockManager"/> (paint styles and startup containter type). /// </summary> void Init() { // Enable double buffering. SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); // Set container type to document and clear removeable flag to prevent manager to destroy itself. DockType = DockContainerType.Document; removeable = false; // Create event handler. dragWindowHandler = new DockEventHandler(this.DragWindow); DockManager.RegisterManager(this); }
internal static void RegisterContainer(DockContainer cont) { if (contList.Contains(cont)) { return; } if (cont == null) { throw new ArgumentNullException("The container must not be null."); } cont.Disposed += new EventHandler(ObjectDisposed); contList.Add(cont); dragEvent += cont.dragWindowHandler; }
/// <summary> /// The central initialization method for all constructors. /// </summary> private void Init() { dragWindowHandler = new DockEventHandler(this.DragWindow); // Enable double buffering. SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); if (DockManager.Style == DockVisualStyle.VS2003) { topDock = 22; // Create tab left button. btnTabL.Hide(); btnTabL.ShadowColor = Color.Black; btnTabL.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnTabL.Enabled = false; btnTabL.PostPaint += new PaintEventHandler(btnTabL_PostPaint); btnTabL.Click += new EventHandler(btnTabL_Click); this.Controls.Add(btnTabL); // Create tab right button. btnTabR.Hide(); btnTabR.ShadowColor = Color.Black; btnTabR.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnTabR.Enabled = false; btnTabR.PostPaint += new PaintEventHandler(btnTabR_PostPaint); btnTabR.Click += new EventHandler(btnTabR_Click); this.Controls.Add(btnTabR); } else if (DockManager.Style == DockVisualStyle.VS2005) { topDock = 16; // Create autohide button. btnAutoHide.Hide(); btnAutoHide.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnAutoHide.PostPaint += new PaintEventHandler(btnAutoHide_PostPaint); btnAutoHide.Click += new EventHandler(btnAutoHide_Click); this.Controls.Add(btnAutoHide); // Create menu button. btnMenu.Hide(); btnMenu.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnMenu.PostPaint += new PaintEventHandler(btnMenu_PostPaint); btnMenu.Click += new EventHandler(btnMenu_Click); this.Controls.Add(btnMenu); } // Create close button. btnClose.Hide(); btnClose.ShadowColor = Color.Black; btnClose.Anchor = AnchorStyles.Top | AnchorStyles.Right; btnClose.PostPaint += new PaintEventHandler(btnClose_PostPaint); btnClose.Click += new EventHandler(btnClose_Click); this.Controls.Add(btnClose); // Drag Panel. dragPanel.Hide(); dragPanel.MouseDown += new MouseEventHandler(dragPanel_MouseDown); dragPanel.MouseMove += new MouseEventHandler(dragPanel_MouseMove); dragPanel.MouseUp += new MouseEventHandler(dragPanel_MouseUp); dragPanel.Paint += new PaintEventHandler(dragPanel_Paint); this.Controls.Add(dragPanel); // Context menu. miUndock = contextMenuStrip.Items.Add("Undock", null, new EventHandler(UndockClick)); miSep = contextMenuStrip.Items.Add("-"); miClose = contextMenuStrip.Items.Add("Close", null, new EventHandler(CloseClick)); }
/// <summary> /// Initializes the <seealso cref="DockManager"/> (paint styles and startup containter type). /// </summary> void Init() { // Enable double buffering. SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); // Set container type to document and clear removeable flag to prevent manager to destroy itself. DockType = DockContainerType.Document; removeable = false; // Create event handler. dragWindowHandler = new DockEventHandler(this.DragWindow); DockManager.RegisterManager(this); }
internal static void UnRegisterContainer(DockContainer cont) { if (!contList.Contains(cont)) return; dragEvent -= cont.dragWindowHandler; contList.Remove(cont); }
internal static void RegisterContainer(DockContainer cont) { if (contList.Contains(cont)) return; if (cont == null) throw new ArgumentNullException("The container must not be null."); cont.Disposed += new EventHandler(ObjectDisposed); contList.Add(cont); dragEvent += cont.dragWindowHandler; }