Exemple #1
0
 private void SaveButton_Click(object sender, RoutedEventArgs e)
 {
     if (fileName != string.Empty)
     {
         TextFileOperations.WriteTextFileContents(fileName, editor.Text);
     }
 }
Exemple #2
0
 /// <summary>
 /// Open the file after prompting the user for the file name.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OpenButton_Click(object sender, RoutedEventArgs e)
 {
     fileName = GetFileName();
     if (fileName != string.Empty)
     {
         // TODO - Update the UI to use the new method.
         // Call the new read file contents method
         editor.Text = TextFileOperations.ReadAndFilterTextFileContents(fileName);
     }
 }