示例#1
0
 protected void SetData(TreeNode node, DialogDataNode data)
 {
     if (node != null)
     {
         TreeViewModel[node.Tag = data.Tag] = data;
     }
     IsFileEdited = true;
 }
示例#2
0
        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);
        }
示例#3
0
 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;
 }
示例#4
0
        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()));
            }
        }