Beispiel #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));
            }
        }
Beispiel #2
0
 public string Get(string name)
 {
     if (settingsWriter != null)
     {
         var value = settingsWriter.Get(name);
         if (value != null)
         {
             return(value);
         }
     }
     return(settings.Get(name));
 }
Beispiel #3
0
        public string Get(string name)
        {
            var value = settingsWriter?.Get(name);

            return(value ?? settings.Get(name));
        }
Beispiel #4
0
 public string GetRaw(string key)
 {
     return(SettingsWriter.Get(key) ?? SettingsReader.Get(key));
 }