internal void BuildNodeList(int level, DispatcherNode[] nodeList, string[] keyParts) { // find/create subnode nodeList[_Level] = this; DispatcherNode subNode; _ChildIndexLock.Enter(); try { if (!_ChildIndex.TryGetValue(keyParts[_Level], out subNode)) { subNode = new DispatcherNode(_Dispatcher, _Level + 1, this); _ChildIndex.Add(keyParts[_Level], subNode); } } finally { _ChildIndexLock.Leave(); } nodeList[_Level + 1] = subNode; if (level > (_Level + 1)) { subNode.BuildNodeList(level, nodeList, keyParts); } }