/// <summary> /// </summary> /// <param name="node"> /// </param> protected void SetRootNode(KnuBotDialogTree node) { node.ValidateTree(); this.rootNode = node; this.selectedNode = this.rootNode; this.rootNode.SetKnuBot(this); }
/// <summary> /// </summary> /// <param name="dialogTree"> /// </param> /// <returns> /// </returns> public KnuBotDialogTree AddNode(KnuBotDialogTree dialogTree) { this.nodes.Add(dialogTree); dialogTree.Parent = this; dialogTree.SetKnuBot(this.GetBaseKnuBot()); // Get down to root node KnuBotDialogTree temp = this; while (temp.Parent != null) { temp = temp.Parent; } // And lets validate the whole tree again // Better to do this on add, so we see from the stacktrace where it really happened temp.ValidateTree(); return(dialogTree); }