internal void Set(TPath path, object value, IConfigSource source) { path.CheckNotNull(nameof(path)); value.CheckNotNull(nameof(value)); this.Set(tbl => path.SetValue(tbl, TomlObject.CreateFrom(tbl.Root, value, null)), source); }
internal void Set(TPath path, object value, IConfigSource source) { path.CheckNotNull(nameof(path)); value.CheckNotNull(nameof(value)); this.Set(tbl => path.Set(tbl, cur => CreateNewValueObject(cur, tbl.Root, value)), source); }
internal TomlObject GetFromPath(TPath path) { path.CheckNotNull(nameof(path)); var cfg = this.persistable.Load(); return(path.Apply(cfg)); }
internal IConfigSource TryGetSource(TPath path) { path.CheckNotNull(nameof(path)); var cfgTable = this.persistable.LoadSourcesTable(); var source = path.TryApply(cfgTable) as TomlSource; return(source?.Value); }
internal void Set(TPath path, object value) { path.CheckNotNull(nameof(path)); value.CheckNotNull(nameof(value)); bool notStoredInConfigYet = this.TryGetSource(path) == null; if (notStoredInConfigYet) { this.Set(path, value, this.persistable.RootSource); } else { this.Set(tbl => path.Set(tbl, cur => CreateNewValueObject(cur, tbl.Root, value))); } }
internal void Set(TPath path, object value) { path.CheckNotNull(nameof(path)); value.CheckNotNull(nameof(value)); var src = this.TryGetSource(path); bool notStoredInConfigYet = this.TryGetSource(path) == null; if (notStoredInConfigYet) { this.Set(path, value, this.persistable.RootSource); } else { this.Set(tbl => path.SetValue(tbl, TomlObject.CreateFrom(tbl.Root, value, null))); } }