Exemplo n.º 1
0
            private static IConfigProperty <T> GetOrAddProperty <T>(IConfigPropertyBase property)
            {
                if (ConfigPropertyObserver.GetOrAddProperty(property) is IConfigProperty <T> result)
                {
                    return(result);
                }

                throw new ArgumentException(@$ "Config already contains another property with same path '{property.Path}' and different generic type.", nameof(property));
            }
Exemplo n.º 2
0
 public Boolean RemoveValue(IReadOnlyConfigPropertyBase property)
 {
     ConfigPropertyObserver.ThrowIfPropertyNotLinked(property);
     return(RemoveValue(property.Key, property.Sections));
 }
Exemplo n.º 3
0
 public Boolean KeyExist(IReadOnlyConfigPropertyBase property)
 {
     ConfigPropertyObserver.ThrowIfPropertyNotLinked(property);
     return(KeyExist(property.Key, property.Sections));
 }
Exemplo n.º 4
0
 public T GetOrSetValue <T>(IReadOnlyConfigProperty <T> property, T value)
 {
     ConfigPropertyObserver.ThrowIfPropertyNotLinked(property);
     return(GetOrSetValue(property.Key, value, property.CryptKey, property.Converter, property.Sections));
 }
Exemplo n.º 5
0
 public T GetOrSetValue <T>(IReadOnlyConfigProperty <T> property)
 {
     ConfigPropertyObserver.ThrowIfPropertyNotLinked(property);
     return(GetOrSetValue(property, property.DefaultValue));
 }
Exemplo n.º 6
0
 public void ClearProperties()
 {
     ForEachProperty(ClearProperty);
     ConfigPropertyObserver.ClearProperties(this);
 }
Exemplo n.º 7
0
 private void ForEachProperty(Action <IReadOnlyConfigPropertyBase> action)
 {
     ConfigPropertyObserver.ForEachProperty(this, action);
 }
Exemplo n.º 8
0
 public void RemoveProperty(IReadOnlyConfigPropertyBase property)
 {
     ConfigPropertyObserver.ThrowIfPropertyNotLinkedTo(this, property);
     ConfigPropertyObserver.RemoveProperty(property);
     ClearProperty(property);
 }
Exemplo n.º 9
0
 public IEnumerable <IReadOnlyConfigPropertyBase> GetProperties()
 {
     return(ConfigPropertyObserver.GetProperties(this));
 }