Exemplo n.º 1
0
        public void CopyFrom(InheritableDictionary source)
        {
            if (null == source)
            {
                throw new ArgumentNullException(nameof(source));
            }

            foreach (string key in source.LocalKeys())
            {
                Set(key, source.Get(key, false));
            }
        }
Exemplo n.º 2
0
        public IEnumerable <string> AllKeys()
        {
            List <string> existingKeys = new List <string>();

            InheritableDictionary pointer = this;

            do
            {
                foreach (string key in pointer.LocalKeys())
                {
                    if (!existingKeys.Contains(key))
                    {
                        existingKeys.Add(key);
                        yield return(key);
                    }
                }
                pointer = pointer.Parent;
            } while (null != pointer);
        }
Exemplo n.º 3
0
 public InheritableDictionaryKeyNotFoundException(InheritableDictionary inheritableDictionary, string key) : base(key)
 {
     InheritableDictionary = inheritableDictionary;
 }
Exemplo n.º 4
0
 public InheritableDictionary(InheritableDictionary parent, string level) : this(parent)
 {
     Level = level;
 }
Exemplo n.º 5
0
 public InheritableDictionary(InheritableDictionary parent) : this()
 {
     Parent = parent ?? throw new ArgumentNullException(nameof(parent));
 }