예제 #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;
 }