Exemplo n.º 1
0
 public void SaveFile(OptionsDto options)
 {
     if (FileDetails != null)
     {
         fileWriter.CreateOrOverwriteFile(FileDetails.FileName, TextBox.Text);
     }
     else
     {
         var saveFileDialog = new SaveFileDialog();
         if (saveFileDialog.ShowDialog() == DialogResult.OK)
         {
             fileWriter.CreateOrOverwriteFile(saveFileDialog.FileName, TextBox.Text);
             // TODO: Add in correct position, not to the end
             options.AppendToOpenedFiles(saveFileDialog.FileName);
             FileDetails = new FileDetails(saveFileDialog.FileName);
             Text        = FileDetails.ShowFileName;
         }
     }
 }