Example #1
0
 protected virtual void SetValue(T value)
 {
     try
     {
         var strVal = _objToStr(value);
         Config.SetEntry(Key, strVal, Section);
     }
     catch (Exception ex)
     {
         BepInLogger.Log("ConfigWrapper Set Converter Exception: " + ex.Message);
     }
 }
Example #2
0
        protected virtual void SetValue(T value)
        {
            try
            {
                // Always write just in case config was changed from outside
                var strVal = _objToStr(value);
                Config.SetEntry(Key, strVal, Section);

                if (_lastValueSet && Equals(_lastValue, value))
                {
                    return;
                }

                _lastValue    = value;
                _lastValueSet = true;

                OnSettingChanged();
            }
            catch (Exception ex)
            {
                Logger.LogError("ConfigWrapper Set Converter Exception: " + ex.Message);
            }
        }