Example #1
0
        /// <summary> Attempts to close all of a forms covering (child-modal) "children". </summary>
        /// <returns> True if any covering forms were closed. </returns>
        public bool UncoverForm(IFormInterface form, CloseBehavior behavior)
        {
            Frontend.Client.Forms.FormStack formStack = Forms.First;
            int i;

            while (formStack != null)
            {
                for (i = 0; i < formStack.Forms.Count; i++)
                {
                    if (formStack.Forms[i] == form)
                    {
                        for (int j = formStack.Forms.Count - 1; j > i; j--)
                        {
                            if (!formStack.Forms[j].Close(behavior))
                            {
                                return(false);
                            }
                        }
                        return(true);
                    }
                }
                formStack = formStack.Next;
            }
            return(true);
        }
Example #2
0
 /// <summary> Attempts to close the session's forms and returns true if they closed. </summary>
 /// <param name="exclude"> When true, the given root form is omitted. </param>
 public bool CloseAllForms(IHost exclude, CloseBehavior behavior)
 {
     Frontend.Client.Forms.FormStack formStack;
     Frontend.Client.Forms.FormStack next = this.Forms.First;
     while (next != null)
     {
         formStack = next;
         next      = next.Next;                  // remember the next item before it get's lost
         while
         (
             !formStack.IsEmpty() &&
             (
                 (exclude == null) ||
                 (formStack.GetTopmostForm().HostNode != exclude)
             )
         )
         {
             if (!formStack.GetTopmostForm().Close(behavior))
             {
                 return(false);
             }
         }
     }
     return(true);
 }