Exemple #1
0
        private void savebtn_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < tabControl1.TabPages.Count; i++)
            {
                ResultEntity temp = new ResultEntity();
                for (int j = 0; j < tabControl1.TabPages[i].Controls[0].Controls.Count; j++)
                {
                    if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "readytimevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setreadytime(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "namevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setparamatername(tabControl1.TabPages[i].Controls[0].Controls[j].Text.ToString());
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "shuttertimevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setshuttertimes(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "clinevalue")
                    {
                        Settingentity settingentitytemp = (Settingentity)methodtemp.getsettinglist()[i];
                        settingentitytemp.setclinevalue(tabControl1.TabPages[i].Controls[0].Controls[j].Text.ToString());
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "setstartvalue")
                    {
                        temp.setresultname("Control line");
                        temp.setresultstartvalue(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                    else if (tabControl1.TabPages[i].Controls[0].Controls[j].Name == "setendvalue")
                    {
                        temp.setresultname("Control line");
                        temp.setresultendvalue(int.Parse(tabControl1.TabPages[i].Controls[0].Controls[j].Text));
                    }
                }
                Settingentity settingentitytempforresult = (Settingentity)methodtemp.getsettinglist()[i];
                for (int k = 0; k < settingentitytempforresult.getresultentitylist().Count; k++)
                {
                    if (((ResultEntity)settingentitytempforresult.getresultentitylist()[k]).getresultname() == "Control line")
                    {
                        settingentitytempforresult.getresultentitylist().RemoveAt(k);
                    }
                }
                settingentitytempforresult.getresultentitylist().Add(temp);
            }

            Settingdetectsection settemp = new Settingdetectsection(method, formtemp, methodlisttemp, methodtemp, editflag);

            settemp.TopLevel        = false;
            settemp.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            settemp.Dock            = System.Windows.Forms.DockStyle.Fill;
            panel1.Controls.Clear();
            panel1.Controls.Add(settemp);
            settemp.Show();
            //formtemp.OnLoad();
            //method.Dispose();
        }
Exemple #2
0
        private void Addparamaternextbtn_Click(object sender, EventArgs e)
        {
            settingentity.setparamatername(Addparamaternamevalue.Text);
            settingentity.setclinevalue(Addparamaterclinevalue.Text);
            ResultEntity tempresultentity = new ResultEntity();

            tempresultentity.setresultname("Control line");
            tempresultentity.setresultstartvalue(int.Parse(Addparamatersetstartvalue.Text));
            tempresultentity.setresultendvalue(int.Parse(Addparamatersetendvalue.Text));
            settingentity.getresultentitylist().Add(tempresultentity);
            settingentity.setshuttertimes(int.Parse(Addparamatershuttertimevalue.Text));
            settingentity.setreadytime(int.Parse(Addparamaterreadytimevalue.Text));
        }