Example #1
0
 private void InitTextLoadedFromFile(OpenFileForm openFileForm) {
     ClearTargetText();
     _targetTextFromFile = openFileForm.LoadedText;
     openFileForm.ClearLoadedText();
     ShowLoadedFileInfo(openFileForm.LoadedFileName());
     _loadingSource = LoadingSource.File;
 }
Example #2
0
 public void OpenFile() {
     try {
         OpenFileForm openFileForm = new OpenFileForm(_mainController, OpenFileForm.ActiveList.History);
         if (Preferences.Res.ShowOpenFileDialog)
             openFileForm.ShowDialog();
         else
             openFileForm.BrowseFiles();
         if (openFileForm.DialogResult != DialogResult.OK) {
             if (LoadingSource.TextField == _loadingSource)
                 UnlockTargetTextField();
             return;
         }
         InitTextLoadedFromFile(openFileForm);
     }
     catch (MatchesFilesException ex) {
         Messenger.ShowError(ex.Message);
         UnlockTargetTextField();
         return;
     }
 }