Пример #1
0
        private void nextbtn_Click(object sender, EventArgs e)
        {
            MySqlDataReader mysqlreader = database.select("Methodtable", "Methodname");

            while (mysqlreader.Read())
            {
                if (mysqlreader[0].ToString().Equals(methodnamevalue.Text) && editflag == 0)
                {
                    MessageBox.Show("method has been created");
                    return;
                }
            }
            ArrayList namelisttemp = new ArrayList();

            methodtemp.setmethodname(methodnamevalue.Text);
            methodtemp.setsensitive(5);
            string line = namevalue.Text;

            //Regex reg = new Regex("[A-Za-z0-9]+");
            string[] match = Regex.Split(line, ",| ,|, ");
            //MatchCollection match = reg.Matches(line);
            if (Paramaternumbertextbox.Text != "" && match.Length == int.Parse(Paramaternumbertextbox.Text))
            {
                for (int i = 0; i < match.Length; i++)
                {
                    Settingentity settingentity = new Settingentity();
                    string        value         = match[i].ToString();
                    namelisttemp.Add(value);
                    settingentity.setparamatername(value);
                    if (methodtemp.getsettinglist().Count > 0)
                    {
                        for (int j = 0; j < methodtemp.getsettinglist().Count; j++)
                        {
                            if (((Settingentity)methodtemp.getsettinglist()[j]).getparamatername() == value)
                            {
                                break;
                            }
                            else if (j == methodtemp.getsettinglist().Count - 1)
                            {
                                methodtemp.getsettinglist().Add(settingentity);
                            }
                        }
                    }
                    else
                    {
                        methodtemp.getsettinglist().Add(settingentity);
                    }
                }
                //namelist = namelisttemp;
                MethodNext temp = new MethodNext(this, formtemp, methodlist, methodtemp, editflag);
                //MethodNext temp = new MethodNext();
                temp.TopLevel        = false;
                temp.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                temp.Dock            = System.Windows.Forms.DockStyle.Fill;
                panel1.Controls.Clear();
                panel1.Controls.Add(temp);
                for (int i = 0; i < namelisttemp.Count; i++)
                {
                    TabPage tab = new TabPage();
                    tab.Name = (string)namelisttemp[i];
                    tab.Text = (string)namelisttemp[i];

                    MethodSettingEntity form = new MethodSettingEntity(this, formtemp, temp, methodlist, methodtemp, i);
                    form.TopLevel = false;
                    tab.Controls.Add(form.panel1);
                    temp.tabControl1.TabPages.Add(tab);
                    form.Show();
                }
                temp.Show();
            }
            else
            {
                MessageBox.Show("Please input correct number");
            }
        }
Пример #2
0
 private void Settingsensitivefinishbtn_Click(object sender, EventArgs e)
 {
     methodtemp.setsensitive(int.Parse(Sensitivevalue.Text));
     methodtemp.setadjustvalue(adjustvalue);
     this.Close();
 }