コード例 #1
0
ファイル: MainForm.cs プロジェクト: NathanLaan/NoteLiner
 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());
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: Redsnowfly/NoteLiner
 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());
     }
 }