Example #1
0
        private void OpenGameSettings()
        {
            Form existe = Application.OpenForms.OfType <Form>().Where(pre => pre.Name == "P_GameSettings").SingleOrDefault <Form>();

            if (existe != null)
            {
                existe.Close();
                existe.Dispose();
                GC.Collect();
            }


            this.Hide();
            GameSettings = new P_GameSettings(objEntidad);
            GameSettings.Show();
        }
Example #2
0
        private void OpenGameSettings()
        {
            Change_Settings();

            // para saber si el formulario existe, o sea, si está abierto o cerrado
            Form existe  = Application.OpenForms.OfType <Form>().Where(pre => pre.Name == "P_GameSettings").SingleOrDefault <Form>();
            Form existe2 = Application.OpenForms.OfType <Form>().Where(pre => pre.Name == "P_Main").SingleOrDefault <Form>();

            if (existe != null)
            {
                existe.Close();
                existe.Dispose();
                GC.Collect();
            }

            GameSettings = new P_GameSettings(objEntidad);
            existe2.Hide();
            GameSettings.ShowDialog();
        }