Inheritance: DockingElementClosedCollection
Exemple #1
0
        private void OnDockingAutoHiddenGroupHoverStart(object sender, KryptonPageEventArgs e)
        {
            // Request the sliding panel slide itself into view with the provided page
            KryptonDockingAutoHiddenGroup dockingGroup = (KryptonDockingAutoHiddenGroup)sender;

            _slidePanel.SlideOut(e.Item, dockingGroup.AutoHiddenGroupControl, false);
        }
Exemple #2
0
        private void OnDockingAutoHiddenGroupDisposed(object sender, EventArgs e)
        {
            // Cast to correct type and unhook event handlers so garbage collection can occur
            KryptonDockingAutoHiddenGroup groupElement = (KryptonDockingAutoHiddenGroup)sender;

            groupElement.PageClicked    -= OnDockingAutoHiddenGroupClicked;
            groupElement.PageHoverStart -= OnDockingAutoHiddenGroupHoverStart;
            groupElement.PageHoverEnd   -= OnDockingAutoHiddenGroupHoverEnd;
            groupElement.Disposed       -= OnDockingAutoHiddenGroupDisposed;

            // Remove the element from our child collection as it is no longer valid
            InternalRemove(groupElement);
        }
Exemple #3
0
 /// <summary>
 /// Perform docking element specific actions for loading a child xml.
 /// </summary>
 /// <param name="xmlReader">Xml reader object.</param>
 /// <param name="pages">Collection of available pages.</param>
 /// <param name="child">Optional reference to existing child docking element.</param>
 protected override void LoadChildDockingElement(XmlReader xmlReader,
                                                 KryptonPageCollection pages,
                                                 IDockingElement child)
 {
     if (child != null)
     {
         child.LoadElementFromXml(xmlReader, pages);
     }
     else
     {
         // Create a new auto hidden group and then reload it
         KryptonDockingAutoHiddenGroup autoHiddenGroup = AppendAutoHiddenGroup(xmlReader.GetAttribute("N"));
         autoHiddenGroup.LoadElementFromXml(xmlReader, pages);
     }
 }
 /// <summary>
 /// Slide the specified page into view and optionally select.
 /// </summary>
 /// <param name="uniqueName">Name of page to slide into view.</param>
 /// <param name="select">True to select the page; otherwise false.</param>
 public void SlidePageOut(string uniqueName, bool select)
 {
     // Search each of our AutoHiddenGroup entries
     for (int i = 0; i < Count; i++)
     {
         KryptonDockingAutoHiddenGroup ahg = this[i] as KryptonDockingAutoHiddenGroup;
         // If the target page is inside this group
         KryptonPage page = ahg?.AutoHiddenGroupControl.Pages[uniqueName];
         if (page != null)
         {
             // Request the sliding panel slide itself into view with the provided page
             KryptonAutoHiddenProxyPage proxyPage = (KryptonAutoHiddenProxyPage)page;
             _slidePanel.SlideOut(proxyPage.Page, ahg.AutoHiddenGroupControl, @select);
             break;
         }
     }
 }
Exemple #5
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);
        }
Exemple #6
0
 /// <summary>
 /// Initialize a new instance of the AutoHiddenGroupEventArgs class.
 /// </summary>
 /// <param name="control">Reference to auto hidden group control instance.</param>
 /// <param name="element">Reference to docking auto hidden group element that is managing the control.</param>
 public AutoHiddenGroupEventArgs(KryptonAutoHiddenGroup control,
                                 KryptonDockingAutoHiddenGroup element)
 {
     AutoHiddenGroupControl = control;
     AutoHiddenGroupElement = element;
 }
 /// <summary>
 /// Initialize a new instance of the AutoHiddenGroupEventArgs class.
 /// </summary>
 /// <param name="control">Reference to auto hidden group control instance.</param>
 /// <param name="element">Reference to docking auto hidden group element that is managing the control.</param>
 public AutoHiddenGroupEventArgs(KryptonAutoHiddenGroup control,
                                 KryptonDockingAutoHiddenGroup element)
 {
     _autoHiddenGroup = control;
     _element         = element;
 }
        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;
        }
 /// <summary>
 /// Initialize a new instance of the AutoHiddenGroupEventArgs class.
 /// </summary>
 /// <param name="control">Reference to auto hidden group control instance.</param>
 /// <param name="element">Reference to docking auto hidden group element that is managing the control.</param>
 public AutoHiddenGroupEventArgs(KryptonAutoHiddenGroup control,
                                 KryptonDockingAutoHiddenGroup element)
 {
     _autoHiddenGroup = control;
     _element = element;
 }