Пример #1
0
 public void OpenDirectoryEvent(object sender, EventArgs e)
 {
     try
     {
         (List <CodeFile> tempFiles, string[] filePaths) = FileModel.OpenFilesFromDir(
             DirPath,
             FilterItem.ToStringArray(FileFilters),
             SelectAll,
             IsShallow,
             SelectedFileType
             );
         AllCodeFiles = new ObservableCollection <CodeFile>(tempFiles);
     }
     catch (Exception exe)
     {
         MessageBox.Show(exe.Message);
     }
 }
Пример #2
0
 public async void RunCleanerEventAsync(object sender, EventArgs e)
 {
     try
     {
         if (FilePaths == null && DirPath == "")
         {
             throw new Exception("No file selected.");
         }
         AllCodeFiles = new ObservableCollection <CodeFile>(
             await FileModel.RunCleanerAsync(
                 DirPath,
                 FilterItem.ToStringArray(FileFilters),
                 SelectAll,
                 SelectedFileType
                 )
             );
     }
     catch (Exception exe)
     {
         MessageBox.Show(exe.Message, "Error");
     }
 }