示例#1
0
        private static IConfigProperty <T> GetOrAddProperty <T>([NotNull] 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));
        }
示例#2
0
        public static void RemoveProperty(IConfigPropertyBase property)
        {
            if (!ConfigDictionary.TryGetValue(property.Config, out IndexDictionary <String, IConfigPropertyBase> dictionary))
            {
                return;
            }

            dictionary.Remove(property.Path);
            ClearProperty(property);
        }
示例#3
0
 private static void ReadProperty(IConfigPropertyBase property)
 {
     property.Read();
 }
示例#4
0
 private static IConfigPropertyBase GetOrAddProperty(IConfigPropertyBase property)
 {
     return(ConfigDictionary.GetOrAdd(property.Config, new IndexDictionary <String, IConfigPropertyBase>())
            .GetOrAdd(property.Path, property));
 }
示例#5
0
 public void RemoveValue(IConfigPropertyBase property)
 {
     RemoveValue(property.Key, property.Sections);
 }
示例#6
0
 public Boolean KeyExist(IConfigPropertyBase property)
 {
     return(KeyExist(property.Key, property.Sections));
 }
示例#7
0
 private static void ClearProperty(IConfigPropertyBase property)
 {
     property.Dispose(true);
 }
示例#8
0
 private static void ResetProperty(IConfigPropertyBase property)
 {
     property.Reset();
 }
示例#9
0
 private static void SaveProperty(IConfigPropertyBase property)
 {
     property.Save();
 }