Пример #1
0
        public JsonSettingsProvider(ISettingsWriter settingsWriter)
        {
            this.settingsWriter = settingsWriter;

            if (string.IsNullOrEmpty(settingsWriter.Get()))
            {
                this.settingsWriter.Save(JsonSerializer.Serialize(new Dictionary <string, object>(), this.serializationOptions));
            }
        }
Пример #2
0
 public string Get(string name)
 {
     if (settingsWriter != null)
     {
         var value = settingsWriter.Get(name);
         if (value != null)
         {
             return(value);
         }
     }
     return(settings.Get(name));
 }
Пример #3
0
        public string Get(string name)
        {
            var value = settingsWriter?.Get(name);

            return(value ?? settings.Get(name));
        }
Пример #4
0
 public string GetRaw(string key)
 {
     return(SettingsWriter.Get(key) ?? SettingsReader.Get(key));
 }