private void StartProcess0(object o) { try { ProcessorArgs processorArgs = (ProcessorArgs)o; ConfigurationMain mainCfg = processorArgs.ConfigurationMain; // Logger.Log("Checking configuration..."); // Progresser.EventStart(ProgressChecking); Progresser.ChangeProgress(ProgressChecking, 0); // if (mainCfg.Passes.Any()) { if (!File.Exists(mainCfg.Paths.PathTexconv)) { throw new FileNotFoundException("Texconv.exe not found. Check your exe paths in tool paths !"); } // if (!File.Exists(mainCfg.Paths.PathTexdiag)) { throw new FileNotFoundException("Texdiag.exe not found. Check your exe paths in tool paths !"); } // if (mainCfg.Passes.Any(p => p.TypePass == TypePass.ApplyGmic) && !File.Exists(mainCfg.Paths.PathGmic)) { throw new FileNotFoundException("Gmic.exe used and not found. Check your exe paths in tool paths !"); } // if (mainCfg.Passes.Any(p => p.TypePass == TypePass.ApplyCustom) && !File.Exists(mainCfg.Paths.PathCustomTool)) { throw new FileNotFoundException("Custom tool used and not found. Check your exe paths in tool paths !"); } } // if (mainCfg.PassBsa.Enabled && !File.Exists(mainCfg.Paths.PathBsarch)) { throw new FileNotFoundException("Bsarch.exe not found. Check your exe paths in tool paths !"); } // Logger.Log("Needed tools are found: ok"); // if (string.IsNullOrEmpty(mainCfg.PathSource)) { throw new ArgumentException("Source folder path is mandatory."); } // if (!(new DirectoryInfo(mainCfg.PathSource).Exists)) { throw new DirectoryNotFoundException("Source folder don't exist."); } // if (mainCfg.IsBackupActivated && string.IsNullOrEmpty(mainCfg.PathBackup)) { throw new ArgumentException("Backup folder path is mandatory when using backup functions."); } // if (mainCfg.IsBackupActivated && !(new DirectoryInfo(mainCfg.PathBackup).Exists)) { throw new DirectoryNotFoundException("Backup folder don't exist."); } // if (mainCfg.IsBackupActivated && Equals(mainCfg.PathSource, mainCfg.PathBackup)) { throw new ArgumentException("Source folder and backup folder cannot be the same."); } // Logger.Log("Configuration: ok"); // mainCfg.Selection.CalculateStartFileValidation(); mainCfg.PassBsa.Selection.CalculateStartFileValidation(); foreach (ConfigurationPass configurationPass in mainCfg.Passes) { configurationPass.Selection.CalculateStartFileValidation(); } // Logger.Log("Initializing validations ok"); // Progresser.ChangeProgress(ProgressChecking, 1); Progresser.EventEnd(ProgressChecking); // OnProcessorEnded(1); } catch (AggregateException e) { Logger.Log(e); foreach (Exception innerException in e.InnerExceptions) { Logger.Log(innerException); } OnProcessorEnded(-1); } catch (Exception e) { Logger.Log(e); OnProcessorEnded(-1); } }
static Progresser() { Instance = new Progresser(); }