Event arguments for a AutoHiddenGroupAdding/AutoHiddenGroupRemoved events.
Inheritance: System.EventArgs
Exemplo n.º 1
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 OnAutoHiddenGroupDisposed(object sender, EventArgs e)
        {
            // Unhook from events so the control can be garbage collected
            AutoHiddenGroupControl.StoringPage -= OnAutoHiddenGroupStoringPage;
            AutoHiddenGroupControl.TabClicked -= OnAutoHiddenGroupTabClicked;
            AutoHiddenGroupControl.TabMouseHoverStart -= OnAutoHiddenGroupHoverStart;
            AutoHiddenGroupControl.TabMouseHoverEnd -= OnAutoHiddenGroupHoverEnd;
            AutoHiddenGroupControl.TabVisibleCountChanged -= OnAutoHiddenGroupTabVisibleCountChanged;
            AutoHiddenGroupControl.Disposed -= OnAutoHiddenGroupDisposed;

            // Events are generated from the parent docking manager
            KryptonDockingManager dockingManager = DockingManager;
            if (dockingManager != null)
            {
                // Allow the auto hidden group to be customized by event handlers
                AutoHiddenGroupEventArgs groupArgs = new AutoHiddenGroupEventArgs(AutoHiddenGroupControl, this);
                dockingManager.RaiseAutoHiddenGroupRemoved(groupArgs);
            }

            // Generate event so interested parties know this element and associated window have been disposed
            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;
        }
        private void OnAutoHiddenGroupDisposed(object sender, EventArgs e)
        {
            // Unhook from events so the control can be garbage collected
            AutoHiddenGroupControl.StoringPage -= new EventHandler<UniqueNameEventArgs>(OnAutoHiddenGroupStoringPage);
            AutoHiddenGroupControl.TabClicked -= new EventHandler<KryptonPageEventArgs>(OnAutoHiddenGroupTabClicked);
            AutoHiddenGroupControl.TabMouseHoverStart -= new EventHandler<KryptonPageEventArgs>(OnAutoHiddenGroupHoverStart);
            AutoHiddenGroupControl.TabMouseHoverEnd -= new EventHandler(OnAutoHiddenGroupHoverEnd);
            AutoHiddenGroupControl.TabVisibleCountChanged -= new EventHandler(OnAutoHiddenGroupTabVisibleCountChanged);
            AutoHiddenGroupControl.Disposed -= new EventHandler(OnAutoHiddenGroupDisposed);

            // Events are generated from the parent docking manager
            KryptonDockingManager dockingManager = DockingManager;
            if (dockingManager != null)
            {
                // Allow the auto hidden group to be customized by event handlers
                AutoHiddenGroupEventArgs groupArgs = new AutoHiddenGroupEventArgs(AutoHiddenGroupControl, this);
                dockingManager.RaiseAutoHiddenGroupRemoved(groupArgs);
            }

            // Generate event so interested parties know this element and associated window have been disposed
            Dispose();
        }
Exemplo n.º 5
0
 /// <summary>
 /// Raises the AutoHiddenGroupRemoved event.
 /// </summary>
 /// <param name="e">An AutoHiddenGroupEventArgs containing the event args.</param>
 protected virtual void OnAutoHiddenGroupRemoved(AutoHiddenGroupEventArgs e)
 {
     if (AutoHiddenGroupRemoved != null)
         AutoHiddenGroupRemoved(this, e);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Raises the AutoHiddenGroupAdding event.
 /// </summary>
 /// <param name="e">An AutoHiddenGroupEventArgs containing the event args.</param>
 protected virtual void OnAutoHiddenGroupAdding(AutoHiddenGroupEventArgs e)
 {
     if (AutoHiddenGroupAdding != null)
         AutoHiddenGroupAdding(this, e);
 }
Exemplo n.º 7
0
 internal void RaiseAutoHiddenGroupRemoved(AutoHiddenGroupEventArgs e)
 {
     OnAutoHiddenGroupRemoved(e);
 }
Exemplo n.º 8
0
 internal void RaiseAutoHiddenGroupAdding(AutoHiddenGroupEventArgs e)
 {
     OnAutoHiddenGroupAdding(e);
 }