Exemplo n.º 1
0
        public static SpreadsheetProgram GetAppContext()
        {
            if (appContext == null)
            {
                appContext = new SpreadsheetProgram();
            }

            return(appContext);
        }
Exemplo n.º 2
0
        public static SpreadsheetProgram GetAppContext()
        {
            if(appContext == null)
            {
                appContext = new SpreadsheetProgram();
            }

            return appContext;
        }
Exemplo n.º 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            SpreadsheetProgram appContext = SpreadsheetProgram.GetAppContext();

            appContext.RunForm(new Form1());
            Application.Run(appContext);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Menu item that opens a spreadsheet file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openMenuItemClickHandler(object sender, EventArgs e)
        {
            OpenFileDialog d = new OpenFileDialog();

            d.CheckFileExists = true;
            d.Filter          = "Spreadsheet File (*.sprd)|*.sprd|All Files (*.*)|*.*";
            DialogResult result   = d.ShowDialog();
            string       filename = "";

            if (result == DialogResult.OK)
            {
                filename = d.FileName;
                SpreadsheetProgram.GetAppContext().RunForm(new Form1(filename));
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Menu item that creates a new spreadsheet file
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void newMenuItemClickHandler(object sender, EventArgs e)
 {
     SpreadsheetProgram.GetAppContext().RunForm(new Form1());
 }