Пример #1
0
 public CommandExecutionService(BackupService backupService, AliasService aliasService,
                                WindowService windowService)
 {
     _backupService = backupService;
     _aliasService  = aliasService;
     _windowService = windowService;
 }
Пример #2
0
        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();
        }
Пример #3
0
        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);
            };
        }
Пример #4
0
        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);
        }
Пример #5
0
        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();
        }
Пример #6
0
 public AuthService(TaskExecutionService taskExecutionService, WindowService windowService)
 {
     _taskExecutionService = taskExecutionService;
     _windowService        = windowService;
 }