Пример #1
0
 public void Load(IRadioEnvironment store)
 {
     foreach (var option in Options)
     {
         option.Load(store);
     }
 }
 public bool Serialize(IRadioEnvironment store, Option option)
 {
     store.Settings.EncoderProfiles.SetDefault(CurrentEncoder.Value as string);
     var returnVal = _old == CurrentEncoder.Value as string;
     _old = CurrentEncoder.Value as string;
     return returnVal;
 }
        public void Deserialize(IRadioEnvironment store, Option option, object defaultValue)
        {
            var provider = defaultValue as IEncoderViewModel;
            if(provider == null) return;
            option.SettingValue = defaultValue;

            provider.Deserialize();
        }
        public virtual void Deserialize(IRadioEnvironment store, Option option, object defaultValue)
        {
            string currentValue = store.Settings.PropertyStore.GetValue(option.SettingKey, defaultValue?.ToString());

            _oldValue = currentValue;
            SetValue(_oldValue);
            option.SettingValue = currentValue;
        }
        public bool Serialize(IRadioEnvironment store, Option option)
        {
            var provider = option.SettingValue as IEncoderViewModel;

            if (provider == null) return false;

            provider.Serialize();

            return true;
        }
        public void Deserialize(IRadioEnvironment store, Option option, object defaultValue)
        {
            var encoder = store.Settings.EncoderProfiles.Default;
            _old = encoder.Item2 != null ? encoder.Item1 : null;

            Profiles = store.Settings.EncoderProfiles.Profiles.Select(s => new CommonComboBoxItem(s, s)).ToList();
            _nullItem = new CommonComboBoxItem(RadioStreamerResources.NoneString, null);

            Reset(option);
            Profiles?.Add(_nullItem);
        }
        public virtual bool Serialize(IRadioEnvironment store, Option option)
        {
            var newValue = GetCurrentValue();
            if(newValue == _oldValue) return false;

            store.Settings.PropertyStore.SetValue(option.SettingKey, newValue);
            _oldValue = newValue;
            option.SettingValue = newValue;

            return true;
        }
Пример #8
0
        public bool Save(IRadioEnvironment store)
        {
            bool ok = false;
            foreach (var option in Options)
            {
                var temp = option.Save(store);
                if (temp)
                    ok = true;
            }

            return ok;
        }
Пример #9
0
        public bool Save(IRadioEnvironment store)
        {
            if (store == null) throw new ArgumentNullException(nameof(store));

            return Helper.Serialize(store, this);
        }
Пример #10
0
 public void Load(IRadioEnvironment store)
 {
     Helper.Deserialize(store, this, DefaultValue);
 }
Пример #11
0
 public override bool Serialize(IRadioEnvironment store, Option option)
 {
     var temp = base.Serialize(store, option);
     _saveAction?.Invoke(CurrentValue ?? false);
     return temp;
 }