public CommandExecutionService(BackupService backupService, AliasService aliasService, WindowService windowService) { _backupService = backupService; _aliasService = aliasService; _windowService = windowService; }
public UpdaterService(TaskExecutionService taskExecutionService, WindowService windowService) { _taskExecutionService = taskExecutionService; _windowService = windowService; // Events _webService.ProgressChanged += (sender, args) => Progress = args.Progress; // Timer _timer.Interval = TimeSpan.FromHours(1).TotalMilliseconds; _timer.Elapsed += (sender, args) => PerformUpdate(); }
public UnhandledExceptionService(WindowService windowService) { // Register global exception handling AppDomain.CurrentDomain.UnhandledException += (s, e) => { var ex = (Exception)e.ExceptionObject; Logger.Record("Unhandled exception occured"); Logger.Record(ex); if (_shouldShowBugReportWindow) { windowService.ShowBugReportWindowAsync(ex).GetResult(); } Application.Current.ShutdownSafe(ExitCode.UnhandledException); }; }
public TaskExecutionService(PersistenceService persistenceService, BackupService backupService, AliasService aliasService, CommandExecutionService commandExecutionService, WindowService windowService) { _persistenceService = persistenceService; _backupService = backupService; _aliasService = aliasService; _commandExecutionService = commandExecutionService; _windowService = windowService; // Delegates _webService.AbortChecker += () => IsAbortPending; _archivingService.AbortChecker += () => IsAbortPending; _apiService.AbortChecker += () => IsAbortPending; // Events _commandExecutionService.FileChangeMade += (sender, args) => _fileChanges.Add(args.FilePath); _webService.ProgressChanged += (sender, args) => UpdateStatus(args.Progress); _archivingService.ProgressChanged += (sender, args) => UpdateStatus(args.Progress); }
public TaskFileBufferService(TaskExecutionService taskExecutionService, WindowService windowService) { _taskExecutionService = taskExecutionService; _windowService = windowService; // Set up watcher string dir = Path.GetDirectoryName(FileSystem.TaskBufferFilePath); string file = Path.GetFileName(FileSystem.TaskBufferFilePath); _watcher = new FileSystemWatcher(dir, file) { IncludeSubdirectories = false, NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.CreationTime | NotifyFilters.FileName }; // Events _watcher.Changed += (sender, args) => ParseBufferFile(); DispatcherHelper.UIDispatcher.InvokeSafeAsync(() => Application.Current.Exit += (sender, args) => DumpQueue()).Forget(); }
public AuthService(TaskExecutionService taskExecutionService, WindowService windowService) { _taskExecutionService = taskExecutionService; _windowService = windowService; }