Пример #1
0
        public void parse_a_two_level_property()
        {
            var path = new DictionaryPath("A.B.a");
            path.Set(theSource, 1);

            theDictionary.Child("A").Child("B")["a"].ShouldEqual(1);
        }
Пример #2
0
 public bool Equals(DictionaryPath other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other._parent, _parent));
 }
 /// <summary>
 /// Can be used with dotted paths like:  AppSettings.Child.Nested.Property1
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public object this[string key]
 {
     get
     {
         var path = new DictionaryPath(key);
         return path.GetParentSource(this).Get(path.Key);
     } 
     set
     {
         var path = new DictionaryPath(key);
         _children[path].Set(path.Key, value);
     }
 }
Пример #4
0
 public bool Equals(DictionaryPath other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other._parent, _parent);
 }