Beispiel #1
0
        public void Show(FormControl form, FormControl parentForm)
        {
            if (form == null)
            {
                throw new ArgumentNullException("AForm");
            }

            Session.DispatcherInvoke
            (
                (System.Action)
                (
                    () =>
            {
                FormStackControl stack;
                if (parentForm != null)
                {
                    stack = _sessionControl.FormStacks.Find(parentForm);
                    if (stack == null)
                    {
                        Error.Fail("The parent form for the form being shown is not a visible, top-level form.");
                    }
                }
                else
                {
                    stack = _sessionControl.FormStacks.Create();
                }
                stack.FormStack.Push(form);
            }
                )
            );
        }
Beispiel #2
0
        public void Close(FormControl form)
        {
            if (form == null)
            {
                throw new ArgumentNullException("AForm");
            }

            Session.DispatcherInvoke
            (
                (System.Action)
                (
                    () =>
            {
                var stack = _sessionControl.FormStacks.Find(form);
                if (stack == null)
                {
                    Error.Fail("The form being closed is not a visible, top-level form.");
                }
                stack.FormStack.Pop();
                if (stack.FormStack.IsEmpty)
                {
                    _sessionControl.FormStacks.Remove(stack);
                }
            }
                )
            );
        }
Beispiel #3
0
 public FormStackControl Find(FormControl form)
 {
     foreach (var item in this)
     {
         if (item.FormStack.TopMatches(form))
         {
             return(item);
         }
     }
     return(null);
 }