Ejemplo n.º 1
0
        internal void AttachNode(Node node, ControlNode parentNode)
        {
            node.NodeSelectionChanged += NodeSelectionChanged;
            node.NodeDirtyChanged     += NodeDirtyChanged;

            if (parentNode != null)
            {
                parentNode.AddChild(node);
            }
            else if (_rootNode == null)
            {
                _rootNode = node;
                Dirty     = true;
            }
            else
            {
                throw new InvalidOperationException("Can't attach orphaned node.");
            }
        }