Пример #1
0
 /// <summary>
 /// Handles the load ss.
 /// </summary>
 /// <param name="filename">The filename.</param>
 private void HandleLoadSS(string filename)
 {
     try { SpreadsheetApplicationContext.GetContext().RunNew(filename); }
     catch (SpreadsheetReadException)
     { return; }
     catch (Exception e) { return; }
 }
Пример #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var context = SpreadsheetApplicationContext.GetContext();

            SpreadsheetApplicationContext.GetContext().RunNew();
            Application.Run(context);
        }
Пример #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Get the application context and run one form inside it
            var context = SpreadsheetApplicationContext.GetContext();

            SpreadsheetApplicationContext.GetContext().RunNew();
            Application.Run(context);
        }
Пример #4
0
 /// <summary>
 /// Opens the spreadsheet at source in a new window.
 /// </summary>
 /// <param name="source">Path of the spreadsheet</param>
 private void HandleOpen(string source)
 {
     try
     {
         Spreadsheet newSpreadsheet = new Spreadsheet(File.OpenText(source));
         SpreadsheetApplicationContext.GetContext().RunNewWithSpreadsheet(newSpreadsheet);
     }catch (IOException)
     {
         window.Message = "Error opening file";
     }
 }
 /// <summary>
 /// Handles a request to open a file, throwing exception if anything goes wrong
 /// </summary>
 private void HandleFileChosen(String filename)
 {
     try
     {
         SpreadsheetApplicationContext.GetContext().RunNew(filename);
     }
     catch (Exception e)
     {
         view.ShowFileOpenErrorBox(e);
     }
 }
Пример #6
0
        /// <summary>
        /// Handles a new window being opened
        /// </summary>
        private void HandleOpen(String filename)
        {
            Regex varPattern = new Regex(@"^[a-zA-Z][1-9]{1}[0-9]{0,1}$");

            try
            {
                TextReader tr = new StreamReader(File.OpenRead(filename));
                SpreadsheetApplicationContext.GetContext().RunNew(true, new Spreadsheet(tr, varPattern), filename);
            }
            catch (Exception)
            {
                MessageBox.Show("Open Failed");
            }
        }
Пример #7
0
 /// <summary>
 /// Fires event to pen new window
 /// </summary>
 public void OpenNew()
 {
     SpreadsheetApplicationContext.GetContext().RunNew();
 }
Пример #8
0
 public void OpenSaved(string fileName)
 {
     SpreadsheetApplicationContext.GetContext().RunNew(fileName);
 }
Пример #9
0
 /// <summary>
 /// Opens a new instance of a spreadsheet window.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleSelectNew(object sender, EventArgs e)
 {
     SpreadsheetApplicationContext.GetContext().RunNew();
 }
Пример #10
0
 /// <summary>
 /// Handles creating a new document.
 /// </summary>
 public void CreateNew()
 {
     SpreadsheetApplicationContext.GetContext().RunLauncher();
 }
Пример #11
0
 /// <summary>
 /// Handles opening a file and creates a new window with the spreadsheet being opened.
 /// If the spreadsheet fails to open a MessageBox is displayed with an appropriate error message.
 /// </summary>
 public void HandleOpen(string path)
 {
     SpreadsheetApplicationContext.GetContext().RunLauncher();
 }
Пример #12
0
 /// <summary>
 /// Opens a new blank spreadsheet
 /// </summary>
 public void OpenNew()
 {
     //runs a new and empty spreadsheet
     SpreadsheetApplicationContext.GetContext().RunNew();
 }
Пример #13
0
 /// <summary>
 /// Open an existinfg file in a new window
 /// </summary>
 /// <param name="filename"></param>
 public void OpenExisting(String filename)
 {
     SpreadsheetApplicationContext.GetContext().OpenNew(filename);
 }
Пример #14
0
 /// <summary>
 /// Opens the help menu if clicked.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void helpToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SpreadsheetApplicationContext.GetContext().OpenHelp();
 }