Esempio n. 1
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     try
     {
         //
         // TODO: Check file name
         //
         if (string.IsNullOrEmpty(Settings.Default.FilePath))
         {
             FileForm fileForm = new FileForm();
             if (DialogResult.OK == fileForm.ShowDialog(this))
             {
                 Settings.Default.FilePath = fileForm.FilePath;
                 Settings.Default.Save();
                 //
                 // TODO: save file
                 //
                 this.list.FilePath = Settings.Default.FilePath;
                 this.list.Create();
             }
             else
             {
                 // TODO: Close application???
                 Application.Exit();
             }
         }
         else
         {
             // TODO: Open file
             DEBUG(Settings.Default.FilePath);
         }
     }
     catch (Exception ex)
     {
         //
         // TODO: Error handling
         //
         MessageBox.Show(ex.ToString());
     }
 }
Esempio n. 2
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     try
     {
         //
         // TODO: Check file name
         //
         if (string.IsNullOrEmpty(Settings.Default.FilePath))
         {
             FileForm fileForm = new FileForm();
             if (DialogResult.OK == fileForm.ShowDialog(this))
             {
                 Settings.Default.FilePath = fileForm.FilePath;
                 Settings.Default.Save();
                 //
                 // TODO: save file
                 //
                 this.list.FilePath = Settings.Default.FilePath;
                 this.list.Create();
             }
             else
             {
                 // TODO: Close application???
                 Application.Exit();
             }
         }
         else
         {
             // TODO: Open file
             DEBUG(Settings.Default.FilePath);
         }
     }
     catch (Exception ex)
     {
         //
         // TODO: Error handling
         //
         MessageBox.Show(ex.ToString());
     }
 }