Event arguments for a DockspaceAdding/DockspaceRemoved events.
Наследование: System.EventArgs
Пример #1
0
        private void OnSlidePanelDisposed(object sender, EventArgs e)
        {
            // Unhook from events so the control can be garbage collected
            _slidePanel.SplitterMoveRect      -= OnSlidePanelSeparatorMoveRect;
            _slidePanel.SplitterMoved         -= OnSlidePanelSeparatorMoved;
            _slidePanel.SplitterMoving        -= OnSlidePanelSeparatorMoving;
            _slidePanel.PageCloseClicked      -= OnSlidePanelPageCloseClicked;
            _slidePanel.PageAutoHiddenClicked -= OnSlidePanelPageAutoHiddenClicked;
            _slidePanel.PageDropDownClicked   -= OnSlidePanelPageDropDownClicked;
            _slidePanel.Disposed -= OnPanelDisposed;

            // Events are generated from the parent docking manager
            KryptonDockingManager dockingManager = DockingManager;

            if (dockingManager != null)
            {
                // Only generate the removed event if we have already fired the adding event.
                if (_panelEventFired)
                {
                    DockspaceEventArgs          dockspaceArgs = new DockspaceEventArgs(_slidePanel.DockspaceControl, null);
                    DockspaceSeparatorEventArgs separatorArgs = new DockspaceSeparatorEventArgs(_slidePanel.SeparatorControl, null);
                    dockingManager.RaiseDockspaceRemoved(dockspaceArgs);
                    dockingManager.RaiseDockspaceSeparatorRemoved(separatorArgs);
                }
            }

            // Make sure the groups panel is also disposed
            if (!_panel.IsDisposed)
            {
                _panel.Dispose();
            }
        }
Пример #2
0
        private KryptonDockingDockspace CreateAndInsertDockspace(int index, string name, Size size)
        {
            // Create a dockspace separator do the dockspace can be resized
            KryptonDockspaceSeparator separatorControl = new KryptonDockspaceSeparator(Edge, false);

            separatorControl.SplitterMoveRect += OnDockspaceSeparatorMoveRect;
            separatorControl.SplitterMoved    += OnDockspaceSeparatorMoved;
            separatorControl.SplitterNotMoved += OnDockspaceSeparatorNotMoved;
            separatorControl.Disposed         += OnDockspaceSeparatorDisposed;

            // Create and add the dockspace to the collection
            KryptonDockingDockspace dockspaceElement = new KryptonDockingDockspace(name, Edge, size);

            dockspaceElement.HasVisibleCells   += OnDockingDockspaceHasVisibleCells;
            dockspaceElement.HasNoVisibleCells += OnDockingDockspaceHasNoVisibleCells;
            dockspaceElement.Disposed          += OnDockingDockspaceDisposed;
            InternalInsert(index, dockspaceElement);

            // Create lookup associations
            _lookupSeparator.Add(separatorControl, dockspaceElement);
            _lookupDockspace.Add(dockspaceElement, separatorControl);

            // Events are generated from the parent docking manager
            KryptonDockingManager dockingManager = DockingManager;

            if (dockingManager != null)
            {
                // Allow the dockspace and dockspace separator to be customized by event handlers
                DockspaceEventArgs          spaceArgs     = new DockspaceEventArgs(dockspaceElement.DockspaceControl, dockspaceElement);
                DockspaceSeparatorEventArgs separatorArgs = new DockspaceSeparatorEventArgs(separatorControl, dockspaceElement);
                dockingManager.RaiseDockspaceAdding(spaceArgs);
                dockingManager.RaiseDockspaceSeparatorAdding(separatorArgs);
            }

            if (index == 0)
            {
                InsertAtOuterMost(separatorControl);
                InsertAtOuterMost(dockspaceElement.DockspaceControl);
            }
            else if (index == (Count - 1))
            {
                InsertAtInnerMost(dockspaceElement.DockspaceControl);
                InsertAtInnerMost(separatorControl);
            }
            else
            {
                KryptonDockingDockspace target = this[index + 1] as KryptonDockingDockspace;
                InsertAfter(dockspaceElement.DockspaceControl, target.DockspaceControl);
                InsertAfter(separatorControl, target.DockspaceControl);
            }

            return(dockspaceElement);
        }
        /// <summary>
        /// Raises the type specific space control removed event determined by the derived class.
        /// </summary>
        protected override void RaiseRemoved()
        {
            // Generate event so the any dockspace customization can be reversed.
            KryptonDockingManager dockingManager = DockingManager;

            if (dockingManager != null)
            {
                DockspaceEventArgs args = new DockspaceEventArgs(DockspaceControl, this);
                dockingManager.RaiseDockspaceRemoved(args);
            }

            // Generate event so interested parties know this element and associated control have been removed
            Dispose();
        }
Пример #4
0
        private KryptonDockingAutoHiddenGroup CreateAndInsertAutoHiddenGroup(int index, string name)
        {
            // Create the new auto hidden group instance and add into our collection
            KryptonDockingAutoHiddenGroup groupElement = new KryptonDockingAutoHiddenGroup(name, Edge);

            groupElement.PageClicked    += OnDockingAutoHiddenGroupClicked;
            groupElement.PageHoverStart += OnDockingAutoHiddenGroupHoverStart;
            groupElement.PageHoverEnd   += OnDockingAutoHiddenGroupHoverEnd;
            groupElement.Disposed       += OnDockingAutoHiddenGroupDisposed;
            InternalInsert(index, groupElement);

            // Events are generated from the parent docking manager
            KryptonDockingManager dockingManager = DockingManager;

            if (dockingManager != null)
            {
                // The hosting panel/sliding panel dockspace/separator are not shown until the first group is added, so only
                // generate the events for allowing customization of the when there is a chance they will become displayed.
                if (!_panelEventFired)
                {
                    AutoHiddenGroupPanelEventArgs panelArgs     = new AutoHiddenGroupPanelEventArgs(_panel, this);
                    DockspaceEventArgs            dockspaceArgs = new DockspaceEventArgs(_slidePanel.DockspaceControl, null);
                    DockspaceSeparatorEventArgs   separatorArgs = new DockspaceSeparatorEventArgs(_slidePanel.SeparatorControl, null);
                    dockingManager.RaiseAutoHiddenGroupPanelAdding(panelArgs);
                    dockingManager.RaiseDockspaceAdding(dockspaceArgs);
                    dockingManager.RaiseDockspaceSeparatorAdding(separatorArgs);
                    _panelEventFired = true;
                }

                // Allow the auto hidden group to be customized by event handlers
                AutoHiddenGroupEventArgs groupArgs = new AutoHiddenGroupEventArgs(groupElement.AutoHiddenGroupControl, groupElement);
                dockingManager.RaiseAutoHiddenGroupAdding(groupArgs);
            }

            // Append to the child collection of groups
            _panel.Controls.Add(groupElement.AutoHiddenGroupControl);
            _panel.Controls.SetChildIndex(groupElement.AutoHiddenGroupControl, (_panel.Controls.Count - 1) - index);

            // When adding the first group the panel will not be visible and so we need to
            // force the calculation of a new size so it makes itself visible.
            _panel.PerformLayout();

            return(groupElement);
        }
        private void OnSlidePanelDisposed(object sender, EventArgs e)
        {
            // Unhook from events so the control can be garbage collected
            _slidePanel.SplitterMoveRect -= new EventHandler<SplitterMoveRectMenuArgs>(OnSlidePanelSeparatorMoveRect);
            _slidePanel.SplitterMoved -= new SplitterEventHandler(OnSlidePanelSeparatorMoved);
            _slidePanel.SplitterMoving -= new SplitterCancelEventHandler(OnSlidePanelSeparatorMoving);
            _slidePanel.PageCloseClicked -= new EventHandler<UniqueNameEventArgs>(OnSlidePanelPageCloseClicked);
            _slidePanel.PageAutoHiddenClicked -= new EventHandler<UniqueNameEventArgs>(OnSlidePanelPageAutoHiddenClicked);
            _slidePanel.PageDropDownClicked -= new EventHandler<CancelDropDownEventArgs>(OnSlidePanelPageDropDownClicked);
            _slidePanel.Disposed -= new EventHandler(OnPanelDisposed);

            // Events are generated from the parent docking manager
            KryptonDockingManager dockingManager = DockingManager;
            if (dockingManager != null)
            {
                // Only generate the removed event if we have already fired the adding event.
                if (_panelEventFired)
                {
                    DockspaceEventArgs dockspaceArgs = new DockspaceEventArgs(_slidePanel.DockspaceControl, null);
                    DockspaceSeparatorEventArgs separatorArgs = new DockspaceSeparatorEventArgs(_slidePanel.SeparatorControl, null);
                    dockingManager.RaiseDockspaceRemoved(dockspaceArgs);
                    dockingManager.RaiseDockspaceSeparatorRemoved(separatorArgs);
                }
            }

            // Make sure the groups panel is also disposed
            if (!_panel.IsDisposed)
                _panel.Dispose();
        }
        private KryptonDockingAutoHiddenGroup CreateAndInsertAutoHiddenGroup(int index, string name)
        {
            // Create the new auto hidden group instance and add into our collection
            KryptonDockingAutoHiddenGroup groupElement = new KryptonDockingAutoHiddenGroup(name, Edge);
            groupElement.PageClicked += new EventHandler<KryptonPageEventArgs>(OnDockingAutoHiddenGroupClicked);
            groupElement.PageHoverStart += new EventHandler<KryptonPageEventArgs>(OnDockingAutoHiddenGroupHoverStart);
            groupElement.PageHoverEnd += new EventHandler<EventArgs>(OnDockingAutoHiddenGroupHoverEnd);
            groupElement.Disposed += new EventHandler(OnDockingAutoHiddenGroupDisposed);
            InternalInsert(index, groupElement);

            // Events are generated from the parent docking manager
            KryptonDockingManager dockingManager = DockingManager;
            if (dockingManager != null)
            {
                // The hosting panel/sliding panel dockspace/separator are not shown until the first group is added, so only
                // generate the events for allowing customization of the when there is a chance they will become displayed.
                if (!_panelEventFired)
                {
                    AutoHiddenGroupPanelEventArgs panelArgs = new AutoHiddenGroupPanelEventArgs(_panel, this);
                    DockspaceEventArgs dockspaceArgs = new DockspaceEventArgs(_slidePanel.DockspaceControl, null);
                    DockspaceSeparatorEventArgs separatorArgs = new DockspaceSeparatorEventArgs(_slidePanel.SeparatorControl, null);
                    dockingManager.RaiseAutoHiddenGroupPanelAdding(panelArgs);
                    dockingManager.RaiseDockspaceAdding(dockspaceArgs);
                    dockingManager.RaiseDockspaceSeparatorAdding(separatorArgs);
                    _panelEventFired = true;
                }

                // Allow the auto hidden group to be customized by event handlers
                AutoHiddenGroupEventArgs groupArgs = new AutoHiddenGroupEventArgs(groupElement.AutoHiddenGroupControl, groupElement);
                dockingManager.RaiseAutoHiddenGroupAdding(groupArgs);
            }

            // Append to the child collection of groups
            _panel.Controls.Add(groupElement.AutoHiddenGroupControl);
            _panel.Controls.SetChildIndex(groupElement.AutoHiddenGroupControl, (_panel.Controls.Count - 1) - index);

            // When adding the first group the panel will not be visible and so we need to
            // force the calculation of a new size so it makes itself visible.
            _panel.PerformLayout();

            return groupElement;
        }
Пример #7
0
        /// <summary>
        /// Raises the type specific space control removed event determinated by the derived class.
        /// </summary>
        protected override void RaiseRemoved()
        {
            // Generate event so the any dockspace customization can be reversed.
            KryptonDockingManager dockingManager = DockingManager;
            if (dockingManager != null)
            {
                DockspaceEventArgs args = new DockspaceEventArgs(DockspaceControl, this);
                dockingManager.RaiseDockspaceRemoved(args);
            }

            // Generate event so interested parties know this element and associated control have been removed
            Dispose();
        }
Пример #8
0
 /// <summary>
 /// Raises the DockspaceRemoved event.
 /// </summary>
 /// <param name="e">An DockspaceAddingEventArgs containing the event args.</param>
 protected virtual void OnDockspaceRemoved(DockspaceEventArgs e)
 {
     if (DockspaceRemoved != null)
         DockspaceRemoved(this, e);
 }
Пример #9
0
 /// <summary>
 /// Raises the DockspaceAdding event.
 /// </summary>
 /// <param name="e">An DockspaceAddingEventArgs containing the event args.</param>
 protected virtual void OnDockspaceAdding(DockspaceEventArgs e)
 {
     if (DockspaceAdding != null)
         DockspaceAdding(this, e);
 }
Пример #10
0
 internal void RaiseDockspaceRemoved(DockspaceEventArgs e)
 {
     OnDockspaceRemoved(e);
 }
Пример #11
0
 internal void RaiseDockspaceAdding(DockspaceEventArgs e)
 {
     OnDockspaceAdding(e);
 }
Пример #12
0
 private void kryptonDockingManager_DockspaceAdding(object sender, DockspaceEventArgs e)
 {
     // Set all new dockspace controls to a larger than default size
     e.DockspaceControl.Size = new Size(250, 250);
 }