Esempio n. 1
0
 private void Settings_SettingsUpdated(object sender, SettingsUpdatedEventArgs args)
 {
     if (_tilePageSettings.Contains(args.Key))
     {
         // Delay the UI refresh in case a lot of updates arrive at the same time
         _updateTimer = ThreadPoolTimer.CreateTimer(UpdateApps, _updateDelay);
     }
 }
Esempio n. 2
0
 private void Settings_SettingsUpdated(object sender, SettingsUpdatedEventArgs args)
 {
     if (sender is SettingsProvider settings)
     {
         switch (args.Key)
         {
         case "SlideshowIntervalSeconds":
             _interval = TimeSpan.FromSeconds(settings.SlideshowIntervalSeconds);
             StartSlideshowTimer();
             break;
         }
     }
 }
 private void Settings_SettingsUpdated(object sender, SettingsUpdatedEventArgs args)
 {
     if (sender is SettingsProvider settings)
     {
         switch (args.Key)
         {
         case "SlideshowIntervalSeconds":
             _slideshowTimer?.Cancel();
             _interval       = TimeSpan.FromSeconds(settings.SlideshowIntervalSeconds);
             _slideshowTimer = ThreadPoolTimer.CreatePeriodicTimer(SlideshowTimer_Elapsed, _interval);
             break;
         }
     }
 }
Esempio n. 4
0
 private void Settings_SettingsUpdated(object sender, SettingsUpdatedEventArgs args)
 {
     switch (args.Key)
     {
     case "WeatherLocationLatitude":
     case "WeatherLocationLongitude":
     case "MapSizeExpanded":
     case "MapFlipEnabled":
         _updateSettingsTimer?.Cancel();
         _updateSettingsTimer = ThreadPoolTimer.CreateTimer((t) =>
         {
             InvokeOnUIThread(async() => await RefreshUiAsync());
         }, TimeSpan.FromSeconds(1));
         break;
     }
 }
Esempio n. 5
0
        private void Settings_SettingsUpdated(object sender, SettingsUpdatedEventArgs args)
        {
            if (sender is SettingsProvider settings)
            {
                switch (args.Key)
                {
                case "AppEnableTelemetry":
                    TelemetryService.IsEnabled = settings.AppEnableTelemetry;
                    break;
                }
            }

            // Only send one event if many updates come in at the same time
            _delayTimer?.Cancel();
            _delayTimer = ThreadPoolTimer.CreateTimer((t) =>
            {
                TelemetryService.WriteEvent("AppPreferencesSaved");
            }, TimeSpan.FromSeconds(1));
        }
        private void Settings_SettingsUpdated(object sender, SettingsUpdatedEventArgs args)
        {
            if (sender is SettingsProvider settings)
            {
                switch (args.Key)
                {
                case "AppDefaultPage":
                    PageService.UpdateDefaultPageIcon(settings.GetDefaultPageType().FullName);
                    break;

                case "AppScaling":
                case "AppAutoScaling":
                    RefreshPageSize();
                    break;

                case "ScreensaverEnabled":
                    UpdateScreensaverEnabled();
                    break;
                }
            }
        }
Esempio n. 7
0
        private void OnSettingsUpdated(SettingsUpdatedEventArgs obj)
        {
            if (CurrentlyBuiltFilter?.FilterSectionCollection == null || !CurrentlyBuiltFilter.FilterSectionCollection.Any(x => x.ItemType == EnumFilterSectionItemType.Date && x.IsActive))
            {
                return;
            }

            var dateFilter = FilterModelManager.FilterModelCollection.OfType <FilterDateModel>().FirstOrDefault();

            if (dateFilter != null)
            {
                if (dateFilter.DateFilterType.EnumDateRange != EnumDateFiterStruct.EnumDateFiter.ThisWeek)
                {
                    return;
                }

                var firstDayOfWeek = ServiceLocator.Current.GetInstance <ISettingsService>().GetSettings().GeneralSettings.StartDayOfWeek;
                if (firstDayOfWeek != dateFilter.FirstDayOfWeek)
                {
                    UpdateDateFilter(new DateFilterChangedEventArgs(dateFilter.DateFilterType));
                }
            }
        }
Esempio n. 8
0
        private void CommandIssuer_SettingsUpdated(object sender, SettingsUpdatedEventArgs e)
        {
            var timerSettings = SettingsManager.SimpleSettingsManager.Fetch(e.TimerId);

            this.ApplySettings(timerSettings);
        }
 private void Settings_SettingsUpdated(object sender, SettingsUpdatedEventArgs args)
 {
     NotifyPropertyChanged(args.Key);
 }
Esempio n. 10
0
 private async void SettingsWindow_SettingsUpdated(object sender, SettingsUpdatedEventArgs e)
 {
     await gm.UpdateSettings(e.Settings);
 }
Esempio n. 11
0
        //private void TimePlanCommandIssuer_SettingsChanged(object sender, SettingsChangedEventArgs e)
        //{
        //    //this.timePlanCommandIssuer.CurrentTimerCommandIssuer.OnSettingsChanged(e.Settings);
        //    //this.timePlanCommandIssuer.NextTimerCommandIssuer.OnSettingsChanged(e.Settings);
        //}

        private void TimePlanCommandIssuer_SettingsUpdated(object sender, SettingsUpdatedEventArgs e)
        {
            this.timePlanCommandIssuer.CurrentTimerCommandIssuer.OnSettingsUpdated(e.TimerId);
            this.timePlanCommandIssuer.NextTimerCommandIssuer.OnSettingsUpdated(e.TimerId);
        }