Ejemplo n.º 1
0
        public void Dispose()
        {
            foreach (T form in NavigationStack)
            {
                form.Dispose();
            }

            MdiChildFormPopCallbacks.Clear();
            NavigationStack.Clear();
        }
Ejemplo n.º 2
0
        private void PushInternal(T form, EventHandler <JcwEventArgs <T> > popCallback)
        {
            NavigationStack.Push(form);
            if (popCallback != null)
            {
                MdiChildFormPopCallbacks.Add(form, popCallback);
            }

            DisplayForm(form);
        }
Ejemplo n.º 3
0
        private void PopInternal()
        {
            // Remove the current form from the navigation stack and dispose of it.
            T form = NavigationStack.Pop();

            // If the form being popped set a pop callback when it was pushed onto the navigation
            // stack, execute the callback now.
            if (MdiChildFormPopCallbacks.ContainsKey(form))
            {
                EventHandler <JcwEventArgs <T> > handler = MdiChildFormPopCallbacks[form];
                if (handler != null)
                {
                    handler(this, new JcwEventArgs <T> (form));
                }
            }

            // Dispose of all forms that are popped except for the root form.
            if (form != RootForm)
            {
                form.Dispose();
            }
        }