コード例 #1
0
        public AccountControlViewModel(
            IAccountManager accountManager,
            ITelemetry telemetry,
            ISyncEngine syncEngine,
            ISystemInfoProvider systemInfoProvider,
            INavigator navigator)
        {
            Guard.IsNotNull(accountManager, nameof(accountManager));
            Guard.IsNotNull(telemetry, nameof(telemetry));
            Guard.IsNotNull(syncEngine, nameof(syncEngine));
            Guard.IsNotNull(navigator, nameof(navigator));
            Guard.IsNotNull(systemInfoProvider, nameof(systemInfoProvider));

            _systemInfoProvider = systemInfoProvider;
            _accountManager     = accountManager;
            _telemetry          = telemetry;
            _syncEngine         = syncEngine;
            _navigator          = navigator;

            _accountManager.SignInUpdated += OnSignInUpdated;
            _syncEngine.SyncStarted       += OnSyncStarted;
            _syncEngine.SyncCompleted     += OnSyncCompleted;

            SignInCommand         = new RelayCommand(SignIn);
            OpenUploadPageCommand = new RelayCommand(UploadClicked);
            SignOutCommand        = new AsyncRelayCommand(SignOutAsync);
            SyncCommand           = new AsyncRelayCommand(SyncAsync);
        }
コード例 #2
0
        public ShellPageViewModel(
            IUserSettings userSettings,
            ITimerService timer,
            ITelemetry telemetry,
            ISystemInfoProvider systemInfoProvider)
        {
            Guard.IsNotNull(userSettings, nameof(userSettings));
            Guard.IsNotNull(timer, nameof(timer));
            Guard.IsNotNull(telemetry, nameof(telemetry));

            _userSettings = userSettings;
            _ratingTimer  = timer;
            _telemetry    = telemetry;

            _userSettings.SettingSet += OnSettingSet;

            var lastDismissDateTime = _userSettings.GetAndDeserialize <DateTime>(UserSettingsConstants.RatingDismissed);

            if (!systemInfoProvider.IsFirstRun() &&
                !systemInfoProvider.IsTenFoot() &&
                !_userSettings.Get <bool>(UserSettingsConstants.HasRated) &&
                lastDismissDateTime.AddDays(7) <= DateTime.UtcNow)
            {
                _ratingTimer.Interval         = 1800000; // 30 minutes
                _ratingTimer.IntervalElapsed += OnIntervalLapsed;
                _ratingTimer.Start();
            }
        }
コード例 #3
0
 public CompressRuner(ILogger logger, ISystemInfoProvider systemInfoProvider, Action <Exception> applExceptionHandler,
                      IQueue sourceQueue, IQueue nextQueue) : base(logger, systemInfoProvider, applExceptionHandler, sourceQueue, nextQueue)
 {
     InnerThread = new Thread(Run)
     {
         Name = "CompressRuner"
     };
     InnerThread.Start();
 }
コード例 #4
0
ファイル: QueueHandlerBase.cs プロジェクト: stovpyak/gzip
 protected QueueHandlerBase(ILogger logger, ISystemInfoProvider systemInfoProvider, Action <Exception> applExceptionHandler,
                            IQueue sourceQueue, IQueue nextQueue)
 {
     Logger               = logger;
     SystemInfoProvider   = systemInfoProvider;
     ApplExceptionHandler = applExceptionHandler;
     SourceQueue          = sourceQueue;
     NextQueue            = nextQueue;
 }
コード例 #5
0
ファイル: WorkerBase.cs プロジェクト: stovpyak/gzip
 protected WorkerBase(string name, ILogger logger, Action <Exception> exceptionHandler,
                      ISystemInfoProvider systemInfoProvider, ProcessStatistic statistic, IQueue nextQueue)
 {
     Name                = name;
     _logger             = logger;
     _exceptionHandler   = exceptionHandler;
     _systemInfoProvider = systemInfoProvider;
     _statistic          = statistic;
     _nextQueue          = nextQueue;
 }
コード例 #6
0
 public OnlineSoundDataProvider(
     HttpClient httpClient,
     ISystemInfoProvider systemInfoProvider,
     IAppSettings appSettings)
 {
     Guard.IsNotNull(systemInfoProvider, nameof(systemInfoProvider));
     Guard.IsNotNull(httpClient, nameof(httpClient));
     _systemInfoProvider = systemInfoProvider;
     _client             = httpClient;
     _url         = appSettings.CatalogueUrl;
     _mySoundsUrl = appSettings.MySoundsUrl;
 }
コード例 #7
0
ファイル: Writer.cs プロジェクト: stovpyak/gzip
        public Writer(ILogger logger, ISystemInfoProvider systemInfoProvider, Action <Exception> applExceptionHandler,
                      IFileNameProvider targetFileNameProvider, ManualResetEventSlim stopEvent, IQueue sourceQueue, IQueue nextQueue) :
            base(logger, systemInfoProvider, applExceptionHandler, sourceQueue, nextQueue)
        {
            _targetFileNameProvider = targetFileNameProvider;
            _stopEvent = stopEvent;

            InnerThread = new Thread(Run)
            {
                Name = "Writer"
            };
            InnerThread.Start();
        }
コード例 #8
0
ファイル: Reader.cs プロジェクト: stovpyak/gzip
        public Reader(ILogger logger, ISystemInfoProvider systemInfoProvider, Action <Exception> applExceptionHandler,
                      IFileNameProvider sourceFileNameProvider, IPartReader partReader, IQueue sourceQueue, IQueue nextQueue) :
            base(logger, systemInfoProvider, applExceptionHandler, sourceQueue, nextQueue)
        {
            _sourceFileNameProvider = sourceFileNameProvider;
            _partReader             = partReader;

            InnerThread = new Thread(Run)
            {
                Name = "Reader"
            };
            InnerThread.Start();
        }
コード例 #9
0
 public SettingsViewModel(
     IUserSettings userSettings,
     IScreensaverService screensaverService,
     ISystemInfoProvider systemInfoProvider,
     IStoreNotificationRegistrar notifications)
 {
     Guard.IsNotNull(userSettings, nameof(userSettings));
     Guard.IsNotNull(notifications, nameof(notifications));
     Guard.IsNotNull(screensaverService, nameof(screensaverService));
     Guard.IsNotNull(systemInfoProvider, nameof(systemInfoProvider));
     _systemInfoProvider = systemInfoProvider;
     _screensaverService = screensaverService;
     _userSettings       = userSettings;
     _notifications      = notifications;
     _theme = _userSettings.Get <string>(UserSettingsConstants.Theme);
     InitializeTheme();
 }
コード例 #10
0
 public SettingsViewModel(
     IUserSettings userSettings,
     IScreensaverService screensaverService,
     ISystemInfoProvider systemInfoProvider,
     IStoreNotificationRegistrar notifications,
     ITelemetry telemetry)
 {
     Guard.IsNotNull(userSettings, nameof(userSettings));
     Guard.IsNotNull(notifications, nameof(notifications));
     Guard.IsNotNull(screensaverService, nameof(screensaverService));
     Guard.IsNotNull(systemInfoProvider, nameof(systemInfoProvider));
     Guard.IsNotNull(telemetry, nameof(telemetry));
     _systemInfoProvider = systemInfoProvider;
     _screensaverService = screensaverService;
     _userSettings       = userSettings;
     _notifications      = notifications;
     _telemetry          = telemetry;
 }
コード例 #11
0
        public ThemeSettingsViewModel(
            IUserSettings userSettings,
            ISystemInfoProvider systemInfoProvider,
            IImagePicker imagePicker,
            ITelemetry telemetry)
        {
            Guard.IsNotNull(userSettings, nameof(userSettings));
            Guard.IsNotNull(systemInfoProvider, nameof(systemInfoProvider));
            Guard.IsNotNull(imagePicker, nameof(imagePicker));
            Guard.IsNotNull(telemetry, nameof(telemetry));

            _systemInfoProvider = systemInfoProvider;
            _userSettings       = userSettings;
            _imagePicker        = imagePicker;
            _telemetry          = telemetry;

            SelectImageCommand = new RelayCommand <string>(SelectImage);
            LoadImagesCommand  = new AsyncRelayCommand(LoadImagesAsync);
            BrowseCommand      = new AsyncRelayCommand(BrowseForImageAsync);
        }
コード例 #12
0
        public AccountControlViewModel(
            IAccountManager accountManager,
            ITelemetry telemetry,
            ISyncEngine syncEngine,
            ISystemInfoProvider systemInfoProvider,
            INavigator navigator)
        {
            Guard.IsNotNull(accountManager, nameof(accountManager));
            Guard.IsNotNull(telemetry, nameof(telemetry));
            Guard.IsNotNull(syncEngine, nameof(syncEngine));
            Guard.IsNotNull(navigator, nameof(navigator));
            Guard.IsNotNull(systemInfoProvider, nameof(systemInfoProvider));

            _systemInfoProvider = systemInfoProvider;
            _accountManager     = accountManager;
            _telemetry          = telemetry;
            _syncEngine         = syncEngine;
            _navigator          = navigator;

            SignInCommand  = new AsyncRelayCommand(SignIn);
            SignOutCommand = new AsyncRelayCommand(SignOutAsync);
            SyncCommand    = new AsyncRelayCommand(SyncAsync);
        }
コード例 #13
0
 protected QueueHandlerWithWorkers(ILogger logger, ISystemInfoProvider systemInfoProvider, Action <Exception> applExceptionHandler,
                                   IQueue sourceQueue, IQueue nextQueue) :
     base(logger, systemInfoProvider, applExceptionHandler, sourceQueue, nextQueue)
 {
 }
コード例 #14
0
 public HomeViewModel(ISystemInfoProvider systemInfoProvider)
 {
     SystemInfo          = new SystemInfo();
     _systemInfoProvider = systemInfoProvider;
 }
コード例 #15
0
ファイル: Appl.cs プロジェクト: stovpyak/gzip
 public Appl(ILogger logger, ISystemInfoProvider systemInfoProvider)
 {
     _logger             = logger;
     _systemInfoProvider = systemInfoProvider;
 }
コード例 #16
0
 public SqliteConnectionProvider(ISystemInfoProvider systemInfoProvider)
 {
     _systemInfoProvider = systemInfoProvider;
     _sqLitePlatform     = _systemInfoProvider.SqLitePlatform;
 }
コード例 #17
0
 public SmartCompressStrategy(ISystemInfoProvider systemInfoProvider)
 {
     _systemInfoProvider = systemInfoProvider;
 }
コード例 #18
0
ファイル: Decompressor.cs プロジェクト: stovpyak/gzip
 public Decompressor(string name, ILogger logger, Action <Exception> exceptionHandler,
                     ISystemInfoProvider systemInfoProvider, ProcessStatistic statistic, IQueue nextQueue) :
     base(name, logger, exceptionHandler, systemInfoProvider, statistic, nextQueue)
 {
 }