コード例 #1
0
        public ActionResult CookiesConcentClosed()
        {
            // Get current settings
            var settings = _userSettingsService.Get();

            // Set new value
            settings.CookiesConcentClosed = true;
            // Save settings
            _userSettingsService.Set(settings);
            return(Json("true"));
        }
コード例 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 private LayoutViewModel()
 {
     using (var db = new DataService())
     {
         Categories   = db.GetGateoriesCounters();
         Archives     = db.GetArchives();
         User         = UserService.Get(db);
         UserSettings = UserSettingsService.Get();
     }
 }
コード例 #3
0
        public async Task Save_AllSettingTrue_GetReturnsSameResult(bool vibroEnabled, bool soundsEnabled)
        {
            //arrange
            var userSettingsService = new UserSettingsService(_cache, _webService, _toastService);

            var settings = await userSettingsService.Get();

            settings.IsSoundsEnabled = soundsEnabled;
            settings.IsVibroEnabled  = vibroEnabled;

            //act
            await userSettingsService.Save(settings);

            //assert
            var newSettings = await userSettingsService.Get();

            Assert.True(newSettings.IsVibroEnabled == vibroEnabled);
            Assert.True(newSettings.IsSoundsEnabled == soundsEnabled);
        }
コード例 #4
0
        public JsonResult SetDyslexicFont()
        {
            // Get current settings
            var settings = UserSettingsService.Get();

            // Set new value
            settings.UseDyslexicFont = true;
            // Save settings
            UserSettingsService.Set(settings);
            return(Json(settings.LayoutContentUrl));
        }
コード例 #5
0
        private static AccessibilitySettings GetAccessibilityModel()
        {
            // Get current settings
            var settings = UserSettingsService.Get();

            AccessibilitySettings model = new AccessibilitySettings
            {
                UseDyslexicFont = settings.UseDyslexicFont
            };

            return(model);
        }
コード例 #6
0
        public async Task Remove_SettingsWasChanged_GetReturnDefaultSettings(bool vibroEnabled, bool soundsEnabled)
        {
            //arrange
            var userSettingsService = new UserSettingsService(_cache, _webService, _toastService);

            var settings = await userSettingsService.Get();

            settings.IsSoundsEnabled = soundsEnabled;
            settings.IsVibroEnabled  = vibroEnabled;

            //act
            await userSettingsService.Save(settings);

            await userSettingsService.Remove();

            //assert
            var newSettings = await userSettingsService.Get();

            Assert.True(newSettings.IsVibroEnabled);
            Assert.True(newSettings.IsSoundsEnabled);
        }