Exemple #1
0
        /// <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();
        }
Exemple #2
0
        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();
        }