Esempio n. 1
0
        public BluetoothProfileActivator(IBluetoothService bluetoothService,
                                         IPersonalizationSettings personalizationSettings,
                                         ISchedulerProvider schedulerProvider,
                                         ILoggerFactory loggerFactory)
        {
            _bluetoothService        = bluetoothService;
            _personalizationSettings = personalizationSettings;
            _schedulerProvider       = schedulerProvider;
            _logger             = loggerFactory.CreateLogger(GetType());
            _bluetoothEventLoop = _schedulerProvider.CreateEventLoopScheduler("BluetoothActivator");
            _logger.Verbose("BluetoothProfileActivator.ctor();");

            _profileActivated = _bluetoothService.IdentitiesActivated(_bluetoothEventLoop)
                                .Retry()
                                .Repeat()
                                .Log(_logger, "IdentitiesActivated")
                                .Select(Translate)
                                .Publish();

            //HACK: Avoid work in the ctor. Can be smart here using SelectMany on the IsEnabled + Connecting when ProfileActivated is subscribed to. -LC
            if (_bluetoothService.IsSupported && IsEnabled)
            {
                _connection.Disposable = _profileActivated.Connect();
            }
        }
Esempio n. 2
0
        public static bool GetAsBool(this IPersonalizationSettings settings, string key, bool fallbackValue)
        {
            var value = settings.Get(key);

            return(value == null
                ? fallbackValue
                : bool.Parse(value));
        }
 public ToolbarController(IRegionManager regionManager,
     ISchedulerProvider schedulerProvider,
     IPersonalizationSettings settings,
     ISettingsView settingsView,
     IConnectivitySettingsView connectivitySettingsView,
     IAccountSettingsView accountSettingsView,
     IDemoView demoView)
 {
     _regionManager = regionManager;
     _schedulerProvider = schedulerProvider;
     _settings = settings;
     _settingsView = settingsView;
     _connectivitySettingsView = connectivitySettingsView;
     _accountSettingsView = accountSettingsView;
     _demoView = demoView;
     _taskTaskbarIcon = new TaskbarIcon();
 }
Esempio n. 4
0
 public ToolbarController(IRegionManager regionManager,
                          ISchedulerProvider schedulerProvider,
                          IPersonalizationSettings settings,
                          ISettingsView settingsView,
                          IConnectivitySettingsView connectivitySettingsView,
                          IAccountSettingsView accountSettingsView,
                          IDemoView demoView)
 {
     _regionManager            = regionManager;
     _schedulerProvider        = schedulerProvider;
     _settings                 = settings;
     _settingsView             = settingsView;
     _connectivitySettingsView = connectivitySettingsView;
     _accountSettingsView      = accountSettingsView;
     _demoView                 = demoView;
     _taskTaskbarIcon          = new TaskbarIcon();
 }
        public BluetoothProfileActivator(IBluetoothService bluetoothService,
            IPersonalizationSettings personalizationSettings,
            ISchedulerProvider schedulerProvider,
            ILoggerFactory loggerFactory)
        {
            _bluetoothService = bluetoothService;
            _personalizationSettings = personalizationSettings;
            _schedulerProvider = schedulerProvider;
            _logger = loggerFactory.CreateLogger(GetType());
            _bluetoothEventLoop = _schedulerProvider.CreateEventLoopScheduler("BluetoothActivator");
            _logger.Verbose("BluetoothProfileActivator.ctor();");

            _profileActivated = _bluetoothService.IdentitiesActivated(_bluetoothEventLoop)
                .Retry()
                .Repeat()
                .Log(_logger, "IdentitiesActivated")
                .Select(Translate)
                .Publish();

            //HACK: Avoid work in the ctor. Can be smart here using SelectMany on the IsEnabled + Connecting when ProfileActivated is subscribed to. -LC
            if (_bluetoothService.IsSupported && IsEnabled)
                _connection.Disposable = _profileActivated.Connect();
        }
Esempio n. 6
0
 public AccountSettingsModel(IEnumerable <IAccountConfiguration> accountConfigurations, IPersonalizationSettings settings)
 {
     _accountConfigurations = accountConfigurations;
     _settings = settings;
 }
 public ConnectivitySettingsModel(IEnumerable<IConnectionConfiguration> connectionConfigurations, IPersonalizationSettings settings)
 {
     _connectionConfigurations = connectionConfigurations;
     _settings = settings;
 }
 public AccountSettingsModel(IEnumerable<IAccountConfiguration> accountConfigurations, IPersonalizationSettings settings)
 {
     _accountConfigurations = accountConfigurations;
     _settings = settings;
 }
Esempio n. 9
0
 public ConnectivitySettingsModel(IEnumerable <IConnectionConfiguration> connectionConfigurations, IPersonalizationSettings settings)
 {
     _connectionConfigurations = connectionConfigurations;
     _settings = settings;
 }
Esempio n. 10
0
 public static void SetAsBool(this IPersonalizationSettings settings, string key, bool value)
 {
     settings.Put(key, value.ToString());
 }