Esempio n. 1
0
 /// <summary>
 /// Returns the one DemoApplicationContext.
 /// </summary>
 public static DemoApplicationContext getAppContext()
 {
     if (appContext == null)
     {
         appContext = new DemoApplicationContext();
     }
     return appContext;
 }
Esempio n. 2
0
 /// <summary>
 /// Returns the one DemoApplicationContext.
 /// </summary>
 public static DemoApplicationContext getAppContext()
 {
     if (appContext == null)
     {
         appContext = new DemoApplicationContext();
     }
     return(appContext);
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 // 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());
 }
Esempio n. 5
0
 /// <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());
 }