ComponentFactory.Krypton.Docking.KryptonDockingManager.CloseRequest C# (CSharp) Method

CloseRequest() public method

Perform the close request for a set of named pages.
public CloseRequest ( string uniqueNames ) : void
uniqueNames string Array of unique names that need action performed.
return void
        public virtual void CloseRequest(string[] uniqueNames)
        {
            // Cannot action a null reference
            if (uniqueNames == null)
                throw new ArgumentNullException("uniqueNames");

            // Cannot action an empty array
            if (uniqueNames.Length == 0)
                throw new ArgumentOutOfRangeException("uniqueNames", "array cannot be empry");

            // Cannot action a null or zero length unique name
            foreach (string uniqueName in uniqueNames)
            {
                if (uniqueName == null)
                    throw new ArgumentNullException("uniqueNames array contains a null string reference");

                if (uniqueName.Length == 0)
                    throw new ArgumentException("uniqueNames array contains a zero length string");
            }

            using (DockingMultiUpdate update = new DockingMultiUpdate(this))
            {
                CloseRequestEventArgs e;
                foreach (string uniqueName in uniqueNames)
                {
                    // Raise event that allows the action to be defined by handlers
                    e = new CloseRequestEventArgs(uniqueName, DefaultCloseRequest);
                    OnPageCloseRequest(e);

                    switch (e.CloseRequest)
                    {
                        case DockingCloseRequest.None:
                            // Nothing to do!
                            break;
                        case DockingCloseRequest.RemovePage:
                        case DockingCloseRequest.RemovePageAndDispose:
                            PropogateAction(e.CloseRequest == DockingCloseRequest.RemovePageAndDispose ?
                                                DockingPropogateAction.RemoveAndDisposePages :
                                                DockingPropogateAction.RemovePages,
                                            new string[] { uniqueName });
                            break;
                        case DockingCloseRequest.HidePage:
                            PropogateAction(DockingPropogateAction.HidePages, new string[] { uniqueName });
                            break;
                    }
                }
            }
        }
KryptonDockingManager