示例#1
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (Source.SelectedItems.Count > 0)
            {
                UserTextInput inpForm = new UserTextInput();
                inpForm.textinfo.Text = "";
                if (inpForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    ListViewItem lwAdd = new ListViewItem();
                    lwAdd.Text = Source.SelectedItems[0].Text;
                    lwAdd.Name = Source.SelectedItems[0].Text + 2;
                    if (Source.SelectedItems[0].SubItems[1].Text == "varchar" || Source.SelectedItems[0].SubItems[1].Text == "text")
                    {
                        lwAdd.SubItems.Add("'" + inpForm.textinfo.Text + "'");
                    }
                    else
                    {
                        lwAdd.SubItems.Add(inpForm.textinfo.Text);
                    }

                    lwAdd.Group = listView1.Groups[2];
                    listView1.Items.Add(lwAdd);
                }
            }
        }
示例#2
0
        private String composeCodeByPlaceHolder()
        {
            if (this.widget != null)
            {
                string[] parts = this.widget.CodeInsert.Split(' ');

                string        code  = "";
                UserTextInput input = new UserTextInput();
                input.groupBox.Text = "Insert name of";
                foreach (string pstr in parts)
                {
                    if (pstr.Length > 0 && pstr[0] == '!')
                    {
                        input.textinfo.Text = pstr.Substring(1);
                        if (input.ShowDialog() == DialogResult.OK)
                        {
                            code += input.textinfo.Text.Replace(" ", "_") + " ";
                        }
                        else
                        {
                            code += pstr.Replace("!", "") + " ";
                        }
                    }
                    else
                    {
                        code += pstr + " ";
                    }
                }
                return(code);
            }
            return("");
        }
示例#3
0
        private void addwatchMenuEntry_Click(object sender, EventArgs e)
        {
            UserTextInput addWatchVar = new UserTextInput();

            addWatchVar.textinfo.Text = "";
            addWatchVar.groupBox.Text = "Add Variable to watch...";
            if (addWatchVar.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                varWatchList.Items.Add(addWatchVar.textinfo.Text);
            }
        }
示例#4
0
        private void button2_Click(object sender, EventArgs e)
        {
            //addToCompare(1);
            if (target.SelectedNode != null && target.SelectedNode.Level > 0)
            {
                UserTextInput inpForm = new UserTextInput();
                inpForm.textinfo.Text = "";
                if (inpForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    ListViewItem lwAdd = new ListViewItem();
                    lwAdd.Text = target.SelectedNode.Text;
                    lwAdd.Name = target.SelectedNode.Text + 1;
                    lwAdd.SubItems.Add(inpForm.textinfo.Text);

                    lwAdd.Group = listView1.Groups[1];
                    listView1.Items.Add(lwAdd);
                }
            }
        }