Пример #1
0
        /// <summary>
        /// Propogates an action request down the hierarchy of docking elements.
        /// </summary>
        /// <param name="action">Action that is requested to be performed.</param>
        /// <param name="uniqueNames">Array of unique names of the pages the action relates to.</param>
        public override void PropogateAction(DockingPropogateAction action, string[] uniqueNames)
        {
            switch (action)
            {
            case DockingPropogateAction.StartUpdate:
                // Only the first of several 'StartUpdate' actions needs actioning
                if (_updateCount++ == 0)
                {
                    // Place the obscuring control at the top of the z-order
                    Control.Controls.SetChildIndex(_obscure, 0);

                    // Set obscuring control to take up entire client area and be made visible, this prevents
                    // the drawing of any control underneath it and so prevents any drawing artifacts being seen
                    // until the end of all operations resulting from the request action.
                    _obscure.SetBounds(0, 0, Control.Width, Control.Height);
                    _obscure.Visible = true;
                }
                break;

            case DockingPropogateAction.EndUpdate:
                // Only final matching 'EndUpdate' needs to reverse start action
                if ((_updateCount > 0) && (_updateCount-- == 1))
                {
                    // Multi operation might have caused a change in the inner minimum
                    EnforceInnerMinimum();

                    _obscure.Visible = false;
                }
                break;

            case DockingPropogateAction.ShowPages:
            case DockingPropogateAction.ShowAllPages:
                // Let base class perform actual requested actions
                base.PropogateAction(action, uniqueNames);

                // Ensure that showing extra pages does not trespass on the inner minimum
                if ((action == DockingPropogateAction.ShowPages) ||
                    (action == DockingPropogateAction.ShowAllPages))
                {
                    EnforceInnerMinimum();
                }
                break;

            default:
                // Let base class perform actual requested actions
                base.PropogateAction(action, uniqueNames);
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// Propogates an action request down the hierarchy of docking elements.
        /// </summary>
        /// <param name="action">Action that is requested to be performed.</param>
        /// <param name="uniqueNames">Array of unique names of the pages the action relates to.</param>
        public override void PropogateAction(DockingPropogateAction action, string[] uniqueNames)
        {
            switch (action)
            {
            case DockingPropogateAction.StartUpdate:
                // Only the first of several 'StartUpdate' actions needs actioning
                if (_updateCount++ == 0)
                {
                    // Do not layout the floatspace until all changes have been made
                    FloatingWindow.FloatspaceControl.SuspendWorkspaceLayout();

                    // Place the obscuring control at the top of the z-order
                    FloatingWindow.Controls.SetChildIndex(_obscure, 0);

                    // Set obscuring control to take up entire client area and be made visible, this prevents
                    // the drawing of any control underneath it and so prevents any drawing artifacts being seen
                    // until the end of all operations resulting from the request action.
                    _obscure.SetBounds(0, 0, FloatingWindow.ClientSize.Width, FloatingWindow.ClientSize.Height);
                    _obscure.Visible = true;
                }
                break;

            case DockingPropogateAction.EndUpdate:
                // Only final matching 'EndUpdate' needs to reverse start action
                if ((_updateCount > 0) && (_updateCount-- == 1))
                {
                    FloatingWindow.FloatspaceControl.ResumeWorkspaceLayout();
                    _obscure.Visible = false;
                }
                break;

            default:
                // Let base class perform actual requested actions
                base.PropogateAction(action, uniqueNames);
                break;
            }
        }