/// <summary> /// Runs a form in this application context /// </summary> public void RunNew() { // Create the window and the controller ViewForm window = new ViewForm(); new Controller(window); // One more form is running windowCount++; // When this form closes, we want to find out window.FormClosed += (o, e) => { if (--windowCount <= 0) { ExitThread(); } }; // Run the form window.Show(); }
public void RunNew(Spreadsheet spreadsheet, string filename) { // Create the window and the controller ViewForm window = new ViewForm(); System.Diagnostics.Debug.Print(filename); new Controller(window, spreadsheet, filename); // One more form is running windowCount++; // When this form closes, we want to find out window.FormClosed += (o, e) => { if (--windowCount <= 0) { ExitThread(); } }; // Run the form window.Show(); }