Ejemplo n.º 1
0
        private void HandleFormClosed(object sender, FormClosedEventArgs e)
        {
            //Remove from the dictionaries
            ChompShopWindow window = (ChompShopWindow)sender;

            if (window.Kart == null)
            {
                SingleForms.Remove(window.WindowType);
            }
            else
            {
                if (KartForms.ContainsKey(window.Kart))
                {
                    KartForms[window.Kart].Remove(window.WindowType);
                }
            }
        }
Ejemplo n.º 2
0
        public void ShowSingleForm(ChompShopWindowType type)
        {
            if (SingleForms.ContainsKey(type))
            {
                ChompShopWindow form = SingleForms[type];

                if (form.WindowState == FormWindowState.Minimized)
                {
                    ShowWindow(form.Handle, SW_RESTORE);
                }

                form.BringToFront();
            }
            else
            {
                ChompShopWindow form = GenerateSingleForm(type);

                SingleForms.Add(type, form);
                form.MdiParent    = _parentForm;
                form.FormClosing += HandleFormClosing;
                form.FormClosed  += HandleFormClosed;
                form.Show();
            }
        }