Exemplo n.º 1
0
        private DialogResult initializeDlg(NodeDlg dlg)
        {
            dlg.Node = mNode;
            dlg.Text = "Add Node";
            dlg.ComboBoxGotoSection.DataSource = mProtocol.sectionList();
            DialogResult result = dlg.ShowDialog();

            return(result);
        }
Exemplo n.º 2
0
        private void addAtSameLevelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NodeDlg      dlg    = new NodeDlg();
            DialogResult result = initializeDlg(dlg);

            if (result == DialogResult.OK)
            {
                mProtocol.insertSibling(mNode, dlg.TextBoxNodeText.Text, dlg.ComboBoxGotoSection.Text, null);
            }
            mProtocol.emitSave();
        }
Exemplo n.º 3
0
        private void editNodeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NodeDlg dlg = new NodeDlg();

            dlg.ComboBoxGotoSection.SelectedText = mNode.Element.GotoSection;
            dlg.TextBoxNodeText.Text             = mNode.Element.Text;

            foreach (ProtocolNode node in mProtocol.Node.NodeList)
            {
                dlg.ComboBoxGotoSection.Items.Add(node.Element.Text);
            }
            dlg.ComboBoxGotoSection.SelectedIndex = dlg.ComboBoxGotoSection.FindString(mNode.Element.GotoSection);

            DialogResult result = dlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                mNode.Element.Text        = dlg.TextBoxNodeText.Text;
                mNode.Element.GotoSection = dlg.ComboBoxGotoSection.Text;
            }

            mProtocol.emitSave();
        }