ComponentFactory.Krypton.Docking.KryptonDockingDockspace.PropogateAction C# (CSharp) Method

PropogateAction() public method

Propogates an action request down the hierarchy of docking elements.
public PropogateAction ( DockingPropogateAction action, int value ) : void
action DockingPropogateAction Action that is requested to be performed.
value int Integer value associated with the request.
return void
        public override void PropogateAction(DockingPropogateAction action, int value)
        {
            switch (action)
            {
                case DockingPropogateAction.RepositionDockspace:
                    // Only processs if it applies to us
                    if (value == Order)
                    {
                        Control parent = DockspaceControl.Parent;
                        if (parent != null)
                        {
                            // Process all sibling controls starting from end to front of collection
                            int indexInsert = -1;
                            for (int i = parent.Controls.Count - 1; i >= 0; i--)
                            {
                                Control c = parent.Controls[i];

                                // Insert before the last auto hidden panel/slidepanel (this handles the Order=0 case)
                                if ((c is KryptonAutoHiddenPanel) || (c is KryptonAutoHiddenSlidePanel))
                                    indexInsert = i;

                                // Insert before the 'order' found dockspace separator (this handles the Order>0 cases)
                                if (c is KryptonDockspaceSeparator)
                                {
                                    if (value == 1)
                                    {
                                        indexInsert = i - 1;
                                        break;
                                    }

                                    value--;
                                }
                            }

                            // Did we manage to find an insertion point
                            if (indexInsert >= 0)
                            {
                                // Our separator should be one before is in the controls collection
                                int ourIndex = parent.Controls.IndexOf(DockspaceControl);
                                if (ourIndex > 0)
                                {
                                    Control separator = parent.Controls[ourIndex - 1];
                                    parent.Controls.SetChildIndex(separator, indexInsert);
                                }

                                parent.Controls.SetChildIndex(DockspaceControl, indexInsert);
                            }
                        }
                    }
                    break;
                default:
                    base.PropogateAction(action, value);
                    break;
            }
        }