private void RemoveNode(ContextProviderTreeNode node) { var children = node.Children.ToList(); foreach (var child in children) { node.Detach(child); node.Parent?.Attach(child); } }
public ITreeNode <IContextProvider <IContextProperty <TValue>, TValue> > AddChild(IContextProvider <IContextProperty <TValue>, TValue> node) { var child = new ContextProviderTreeNode(_tree, node) { Parent = this }; _children.Add(child); _tree._nodes.Add(node, child); return(child); }
public ContextProviderTree(IContextProvider <IContextProperty <TValue>, TValue> defaultContext) { Root = new ContextProviderTreeNode(this, defaultContext); }