Example #1
0
 private void FilesWindowCancel_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ProgramFilePath.Text  = SelectedProgrammer.programPath;
         CompilerFilePath.Text = File.ReadAllText(SelectedLanguage);
     }
     catch (FileNotFoundException) { }
     catch (InvalidOperationException exc)
     {
         Result.Text = exc.Message;
     }
     FilesWindowButtons.Check();
 }
Example #2
0
 private void FilesWindowSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (ProgramFilePath.IsEnabled)
         {
             SelectedProgrammer.programPath = ProgramFilePath.Text;
         }
         if (CompilerFilePath.IsEnabled)
         {
             File.WriteAllText(SelectedLanguage, CompilerFilePath.Text);
         }
     }
     catch (InvalidOperationException exc)
     {
         Result.Text = exc.Message;
     }
     FilesWindowButtons.Check();
 }
Example #3
0
 private void LanguageSelect_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (SelectedLanguage == "AUTO" ||
             CompilersDatabase[SelectedLanguage] == NotSupported)
         {
             CompilerFilePath.Clear();
             CompilerFilePath.IsEnabled = false;
             CompilerSelect.IsEnabled   = false;
             FilesWindowButtons.Check();
             return;
         }
         CompilerSelect.IsEnabled   = true;
         CompilerFilePath.IsEnabled = true;
         CompilerFilePath.Text      = File.ReadAllText(SelectedLanguage);
     }
     catch (FileNotFoundException)
     {
         CompilerFilePath.Text = "Компилятор отсутствует";
     }
 }
Example #4
0
 private void ProgramFilePath_TextChanged(object sender, TextChangedEventArgs e)
 {
     FilesWindowButtons.Check();
 }