protected override void OnMouseDown(MouseEventArgs e)
 {
     base.OnMouseDown(e);
     if ((((e.Button == MouseButtons.Left) && this.DockPane.DockPanel.AllowEndUserDocking) && (this.DockPane.AllowDockDragAndDrop && !DockHelper.IsDockStateAutoHide(this.DockPane.DockState))) && (this.DockPane.ActiveContent != null))
     {
         this.DockPane.DockPanel.BeginDrag(this.DockPane);
     }
 }
Exemple #2
0
 internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
 {
     if (!this.IsSuspendSetDockState)
     {
         if (this.DockPanel == null && visibleState != DockState.Unknown)
         {
             throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_NullPanel);
         }
         if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !this.IsDockStateValid(visibleState)))
         {
             throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_InvalidState);
         }
         DockPanel dockPanel = this.DockPanel;
         if (dockPanel != null)
         {
             dockPanel.SuspendLayout(true);
         }
         this.SuspendSetDockState();
         DockState dockState = this.DockState;
         this.SetDockState(isHidden, visibleState, dockState);
         this.GetPane(visibleState);
         if (this.Form.ContainsFocus && (this.DockState == DockState.Hidden || this.DockState == DockState.Unknown))
         {
             this.DockPanel.ContentFocusManager.GiveUpFocus(this.Content);
         }
         this.SetPaneAndVisible(this.Pane);
         if (oldPane != null && !oldPane.IsDisposed && dockState == oldPane.DockState)
         {
             DockContentHandler.RefreshDockPane(oldPane);
         }
         if (this.Pane != null && this.DockState == this.Pane.DockState)
         {
             if (this.Pane != oldPane || (this.Pane == oldPane && dockState != oldPane.DockState))
             {
                 DockContentHandler.RefreshDockPane(this.Pane);
             }
         }
         if (dockState != this.DockState)
         {
             if (this.DockState == DockState.Hidden || this.DockState == DockState.Unknown || DockHelper.IsDockStateAutoHide(this.DockState))
             {
                 this.DockPanel.ContentFocusManager.RemoveFromList(this.Content);
             }
             else
             {
                 this.DockPanel.ContentFocusManager.AddToList(this.Content);
             }
             this.OnDockStateChanged(EventArgs.Empty);
         }
         this.ResumeSetDockState();
         if (dockPanel != null)
         {
             dockPanel.ResumeLayout(true, true);
         }
     }
 }
Exemple #3
0
 public bool IsDockStateValid(DockState dockState)
 {
     return((this.DockPanel == null || dockState != DockState.Document || this.DockPanel.DocumentStyle != DocumentStyle.SystemMdi) && DockHelper.IsDockStateValid(dockState, this.DockAreas));
 }
 private void AutoHide_Click(object sender, EventArgs e)
 {
     base.DockPane.DockState = DockHelper.ToggleAutoHideState(base.DockPane.DockState);
 }