Ejemplo n.º 1
0
        private void SetSettings()
        {
            //TODO:FIXME:all method;
            //TODO:FIXME:??;
            const string keyBase    = "Window:Setting:Option:";
            const string settingEnd = ":Label";
            const string valueEnd   = ":Value:Label";

            TrackingDelaySetting = new NumberRangeSetting
            {
                Value        = _config.GetValue <int>(TrackingDelayConfigKey),
                Min          = WatcherService.MinDelay,
                Max          = WatcherService.MaxDelay,
                SettingLabel = $"{keyBase}TrackingDelay{settingEnd}".Translate(),
                ValueLabel   = $"{keyBase}TrackingDelay{valueEnd}".Translate()
            };

            SavingDelaySetting = new NumberRangeSetting
            {
                Value        = _config.GetValue <int>(SavingDelayConfigKey),
                Min          = SavingService.MinDelay,
                Max          = SavingService.MaxDelay,
                SettingLabel = $"{keyBase}SavingDelay{settingEnd}".Translate(),
                ValueLabel   = $"{keyBase}SavingDelay{valueEnd}".Translate()
            };

            DatabaseSizeSetting = new NumberRangeSetting
            {
                Value        = _config.GetValue <int>(DatabaseSizeConfigKey),
                Min          = SizeLimitDatabaseService.MinSize,
                Max          = SizeLimitDatabaseService.MaxSize,
                SettingLabel = $"{keyBase}DatabaseSize{settingEnd}".Translate(),
                ValueLabel   = $"{keyBase}DatabaseSize{valueEnd}".Translate()
            };

            ClearSetting = new TimePeriod
            {
                Begin = DateTime.Now.Subtract(TimeSpan.FromHours(1)),
                End   = DateTime.Now
            };

            FilterMode = _config.GetValue <bool>(FilterModeConfigKey);
            FilterList = new ObservableCollection <string>(
                _config.GetList <string>(FilterListConfigKey));

            UpdateClearButtonLabel();
        }
Ejemplo n.º 2
0
        private void SetSettings()
        {
            //TODO:FIXME:all method;
            const string templateBase = "Window:Setting:Option:{0}:";
            const string settingLabel = templateBase + "Label";
            const string valueLabel   = templateBase + "Value:Label";

            TrackingDelaySetting = new NumberRangeSetting
            {
                Value        = _config.GetValue <int>(TrackingDelayConfigKey),
                Min          = WatcherService.MinDelay,
                Max          = WatcherService.MaxDelay,
                SettingLabel = Localization[string.Format(settingLabel, "TrackingDelay")],
                ValueLabel   = Localization[string.Format(valueLabel, "TrackingDelay")]
            };

            SavingDelaySetting = new NumberRangeSetting
            {
                Value        = _config.GetValue <int>(SavingDelayConfigKey),
                Min          = SavingService.MinDelay,
                Max          = SavingService.MaxDelay,
                SettingLabel = Localization[string.Format(settingLabel, "SavingDelay")],
                ValueLabel   = Localization[string.Format(valueLabel, "SavingDelay")]
            };

            DatabaseSizeSetting = new NumberRangeSetting
            {
                Value        = _config.GetValue <int>(DatabaseSizeConfigKey),
                Min          = SizeLimitDatabaseService.MinSize,
                Max          = SizeLimitDatabaseService.MaxSize,
                SettingLabel = Localization[string.Format(settingLabel, "DatabaseSize")],
                ValueLabel   = Localization[string.Format(valueLabel, "DatabaseSize")]
            };

            ClearSetting = new TimePeriod
            {
                Begin = DateTime.Now.Subtract(TimeSpan.FromHours(1)),
                End   = DateTime.Now
            };

            FilterMode = _config.GetValue <bool>(FilterModeConfigKey);
            FilterList = new ObservableCollection <string>(
                _config.GetList <string>(FilterListConfigKey));

            UpdateClearButtonLabel();
        }