Beispiel #1
0
 public void DeleteChildNode(char c)
 {
     if (ChildrenMap.ContainsKey(c))
     {
         ChildrenMap.Remove(c);
     }
 }
Beispiel #2
0
        public void Add(ScriptCommand scriptScope)
        {
            if (!AllowDuplicates && ChildrenMap.ContainsKey(scriptScope.Name))
            {
                return;
            }

            Children.Add(scriptScope);
            ChildrenMap[scriptScope.Name] = scriptScope;
            scriptScope.Parent            = this;
        }
Beispiel #3
0
 public void Remove(object scriptScope)
 {
     Children.Remove(scriptScope);
     if (scriptScope is ScriptScope)
     {
         ChildrenMap.Remove(((ScriptScope)scriptScope).Name);
         Scopes.Remove(((ScriptScope)scriptScope));
         ((ScriptScope)scriptScope).Parent = null;
     }
     if (scriptScope is ScriptCommand)
     {
         ChildrenMap.Remove(((ScriptCommand)scriptScope).Name);
         ((ScriptCommand)scriptScope).Parent = null;
     }
 }
        public void RemoveChildContainer(string tag)
        {
            ISettingsContainer child;

            if (ChildrenMap.TryGetValue(tag, out child))
            {
                child.Clear();
                ChildrenMap.Remove(tag);

                if (child is IDisposable)
                {
                    ((IDisposable)child).Dispose();
                }
            }
        }
Beispiel #5
0
        public void Add(ScriptScope scriptScope)
        {
            if (!AllowDuplicates && ChildrenMap.ContainsKey(scriptScope.Name))
            {
                return;
            }

            Children.Add(scriptScope);
            if (scriptScope.Name == null)
            {
                scriptScope.Name = ChildrenMap.Count.ToString();
            }
            ChildrenMap[scriptScope.Name] = scriptScope;
            Scopes.Add(scriptScope);
            scriptScope.Parent = this;
        }
        public ISettingsContainer GetOrCreateChildContainer(string tag)
        {
            if (tag == null)
            {
                throw new ArgumentNullException(nameof(tag));
            }

            ISettingsContainer child;

            if (!ChildrenMap.TryGetValue(tag, out child))
            {
                child            = new ProxySettingsContainer(this, tag);
                ChildrenMap[tag] = child;
            }

            return(child);
        }
Beispiel #7
0
 public TrieNode FindChildNode(char c) => ChildrenMap.ContainsKey(c) ? ChildrenMap[c] : null;