/// <summary> /// Returns the one DemoApplicationContext. /// </summary> public static DemoApplicationContext getAppContext() { if (appContext == null) { appContext = new DemoApplicationContext(); } return appContext; }
/// <summary> /// Returns the one DemoApplicationContext. /// </summary> public static DemoApplicationContext getAppContext() { if (appContext == null) { appContext = new DemoApplicationContext(); } return(appContext); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Start an application context and run one form inside it DemoApplicationContext appContext = DemoApplicationContext.getAppContext(); appContext.RunForm(new spreadsheetWinForm()); Application.Run(appContext); }
// Deals with the New menu private void newToolStripMenuItem_Click(object sender, EventArgs e) { // Tell the application context to run the form on the same // thread as the other forms. DemoApplicationContext.getAppContext().RunForm(new Form1()); }
/// <summary> /// Tells the application context to run the form on the same /// thread as the other forms. /// </summary> private static void RunNewForm() { DemoApplicationContext.getAppContext().RunForm(new SpreadsheetForm()); }