private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (IsSingleInstance) { if (DialogResult.Yes != MessageBox.Show("Close the program?", MessageBoxTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { e.Cancel = true; return; } } IsClosing = true; // if( IsSingleInstance ) // { // SaveAllFiles(); // DisposeOfEverything(); // } if (ThreeDF != null) { if (!ThreeDF.IsDisposed) { ThreeDF.Hide(); ThreeDF.FreeEverything(); ThreeDF.Dispose(); } ThreeDF = null; } FreeEverything(); }
internal void ShowEarthScene() { try { if (ThreeDF == null) { ThreeDF = new ThreeDForm(this); } if (ThreeDF.IsDisposed) { ThreeDF = new ThreeDForm(this); } ThreeDF.Show(); ThreeDF.WindowState = FormWindowState.Maximized; ThreeDF.BringToFront(); } catch (Exception Except) { MessageBox.Show("Exception in MainForm.ShowEarthScene(): " + Except.Message, MessageBoxTitle, MessageBoxButtons.OK); return; } }