Пример #1
0
        /// <summary>
        /// Initializes a new <see cref="DockWindow">DockWindow</see> instance.
        /// </summary>
        public DockWindow()
        {
            this.dockState         = this.DefaultDockState;
            this.previousDockState = this.dockState;
            this.desiredDockState  = this.dockState;
            this.autoHideSize      = Size.Empty;
            this.allowDockStates   = AllowedDockState.All;
            this.closeAction       = this.DefaultCloseAction;

            this.toolCaptionButtons  = ToolStripCaptionButtons.All;
            this.documentButtons     = DocumentStripButtons.All;
            this.defaultFloatingSize = FloatingWindow.DefaultFloatingSize;
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        protected internal override void UpdateButtons()
        {
            base.UpdateButtons();

            if (this.DockManager == null)
            {
                return;
            }

            DockWindow active = this.ActiveWindow;

            if (active == null)
            {
                return;
            }

            ToolStripCaptionButtons buttons = active.ToolCaptionButtons;

            //update close button visibility
            if ((buttons & ToolStripCaptionButtons.Close) == 0)
            {
                this.closeButton.Visibility = ElementVisibility.Collapsed;
            }
            else
            {
                if (this.DockManager.CanChangeWindowState(active, DockState.Hidden, false))
                {
                    this.closeButton.Visibility = ElementVisibility.Visible;
                }
                else
                {
                    this.closeButton.Visibility = ElementVisibility.Collapsed;
                }
            }

            //update auto-hide button visibility
            if ((buttons & ToolStripCaptionButtons.AutoHide) == 0)
            {
                this.autoHideButton.Visibility = ElementVisibility.Collapsed;
            }
            else
            {
                if (this.DockManager.CanChangeWindowState(active, DockState.AutoHide, false))
                {
                    this.autoHideButton.Visibility = ElementVisibility.Visible;
                }
                else
                {
                    this.autoHideButton.Visibility = ElementVisibility.Collapsed;
                }
            }

            //update system menu visiblity
            if ((buttons & ToolStripCaptionButtons.SystemMenu) == 0)
            {
                this.actionMenuButton.Visibility = ElementVisibility.Collapsed;
            }
            else
            {
                this.actionMenuButton.Visibility = ElementVisibility.Visible;
            }
        }