/// <summary> /// Initializes a new instance of the <see cref="AimlExplorerNode" /> class. /// </summary> /// <param name="container">The container.</param> /// <param name="node">The node.</param> /// <exception cref="System.ArgumentNullException">node</exception> internal AimlExplorerNode([NotNull] IObjectContainer container, [NotNull] Node node) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (node == null) { throw new ArgumentNullException(nameof(node)); } _node = node; _container = container; _children = container.ProvideCollection<AimlExplorerNode>(); }
private Node GetOrCreateNode([NotNull] string key) { Node node; if (Children.ContainsKey(key)) { node = Children[key]; Debug.Assert(node != null); } else { node = new Node(key); Children.Add(key, node); } return node; }