protected void SetData(TreeNode node, DialogDataNode data) { if (node != null) { TreeViewModel[node.Tag = data.Tag] = data; } IsFileEdited = true; }
protected void CreateDialogNode(TreeNodeCollection nodes) { TreeNode node = new TreeNode("Double click to edit."); nodes.Add(node); DialogDataNode data = new DialogDataNode(); SetData(node?.Parent, GetData(node?.Parent)?.WithResponse(data.Tag)); SetData(node, data); }
public void SetDialogData(DialogDataNode data) { foreach (string condition in data.Conditions) { DialogConditions.Items.Add(condition); } DialogMessage.Text = data.Message; DialogEmotion.Text = data.Emotion; DialogReaction.Text = data.Reaction; DialogTrigger.Text = data.Trigger; }
protected void EditDialogNode(TreeNode node) { DialogDataEditor dialog = new DialogDataEditor(); dialog.SetDialogData(GetData(node)); if (dialog.ShowDialog() == DialogResult.OK) { DialogDataNode data = GetData(node).Copy(dialog); node.Text = string.Format("[on {0}] - \"{1}\" (if {2})", data.Trigger, data.Message, string.Join(" and ", data.Conditions.ToArray())); } }