private void _dialogTree_AfterSelect(object sender, TreeViewEventArgs e) { _detailsTree.Nodes.Clear(); DialogNode node = (DialogNode)e.Node.Tag; ShowStruct(node.Details, _detailsTree.Nodes); _textView.Text = node.Text; }
private static void AddDialogNode(DialogNode node, TreeNodeCollection nodes) { TreeNode treeNode = nodes.Add(node.DisplayText); treeNode.Tag = node; if (node.HasReplies) { treeNode.Nodes.Add(DUMMY_MARKER); } }
private void _dialogTree_BeforeExpand(object sender, TreeViewCancelEventArgs e) { if (e.Node.Nodes.Count == 1 && e.Node.Nodes[0].Text == DUMMY_MARKER) { e.Node.Nodes.Clear(); DialogNode node = (DialogNode)e.Node.Tag; List <DialogNode> replies = node.Replies; foreach (DialogNode reply in replies) { AddDialogNode(reply, e.Node.Nodes); } } }