Esempio n. 1
0
        public void Load_save()
        {
            Controller.Load();
            for (int i = 0; i < Controller.load_s.Count; i++)
            {
                switch (Controller.load_s[i].type)
                {
                case "if":
                {
                    MVS_Controller.if_operator working_Data = new MVS_Controller.if_operator(this, panel1);
                    string[] text = null;
                    Controller.Create_new_Nod(Controller.load_s[i].name, "if_operator", working_Data, ref text);
                    working_Data.label.Text = Controller.load_s[i].text;
                    working_Data.Butt_ini(text);
                    working_Data.Show();
                    panel1.Controls.Add(working_Data);
                    working_Data.BringToFront();
                    working_Data.Location = new Point(Controller.load_s[i].x, Controller.load_s[i].y);
                    working_Data.Size     = new Size(Controller.load_s[i].Whight, Controller.load_s[i].Height);
                }
                break;

                case "Result":
                {
                    MVS_Controller.Result working_Data = new MVS_Controller.Result(this, panel1);
                    string[] text = null;
                    Controller.Create_new_Nod(Controller.load_s[i].name, "Result", working_Data, ref text);
                    working_Data.label.Text = Controller.load_s[i].text;
                    working_Data.Show();
                    panel1.Controls.Add(working_Data);
                    working_Data.BringToFront();
                    working_Data.Location = new Point(Controller.load_s[i].x, Controller.load_s[i].y);
                    working_Data.Size     = new Size(Controller.load_s[i].Whight, Controller.load_s[i].Height);
                }
                break;

                case "operator":
                {
                    MVS_Controller.Working_data working_Data = new MVS_Controller.Working_data(this, panel1);
                    string[] text = null;
                    Controller.Create_new_Nod(Controller.load_s[i].name, Controller.load_s[i].text.Split('!')[1], working_Data, ref text);
                    working_Data.label.Text = Controller.load_s[i].text.Split('!')[0];
                    working_Data.Show();
                    panel1.Controls.Add(working_Data);
                    working_Data.BringToFront();
                    working_Data.Location = new Point(Controller.load_s[i].x, Controller.load_s[i].y);
                    working_Data.Size     = new Size(Controller.load_s[i].Whight, Controller.load_s[i].Height);
                }
                break;

                case "Data":
                {
                    MVS_Controller.Working_data working_Data = new MVS_Controller.Working_data(this, panel1);
                    string[] text = null;
                    Controller.Create_new_Nod(Controller.load_s[i].name, "Data", working_Data, ref text);
                    working_Data.label.Text = Controller.load_s[i].text;
                    working_Data.Show();
                    panel1.Controls.Add(working_Data);
                    working_Data.BringToFront();
                    working_Data.Location = new Point(Controller.load_s[i].x, Controller.load_s[i].y);
                    working_Data.Size     = new Size(Controller.load_s[i].Whight, Controller.load_s[i].Height);
                }
                break;
                }
            }
            Controller.Load_connect();
        }
Esempio n. 2
0
        private void NOD_button_Click(object sender, EventArgs e)
        {
            int    count = Convert.ToInt32((sender as ToolStripMenuItem).Name);
            string name_main = config_info[count][0], type = config_info[count][1], name_vis = config_info[count][2];

            if (type[type.Length - 1] == '.')
            {
                type = "operator";
            }
            if (type == "if_operator")
            {
                type = "if";
            }
            switch (type)
            {
            case "if":
            {
                MVS_Controller.if_operator working_Data = new MVS_Controller.if_operator(this, panel1);
                string[] text = null;
                Controller.Create_new_Nod(name_main, "if_operator", working_Data, ref text);
                working_Data.label.Text = name_vis;
                working_Data.Butt_ini(text);
                working_Data.Show();
                panel1.Controls.Add(working_Data);
                working_Data.BringToFront();
            }
            break;

            case "Result":
            {
                MVS_Controller.Result working_Data = new MVS_Controller.Result(this, panel1);
                string[] text = null;
                Controller.Create_new_Nod(name_main, "Result", working_Data, ref text);
                working_Data.label.Text = name_vis;
                working_Data.Show();
                panel1.Controls.Add(working_Data);
                working_Data.BringToFront();
            }
            break;

            case "operator":
            {
                MVS_Controller.Working_data working_Data = new MVS_Controller.Working_data(this, panel1);
                string[] text = null;
                Controller.Create_new_Nod(name_main, config_info[count][1].Replace(".", ""), working_Data, ref text);
                working_Data.label.Text = name_vis;
                working_Data.Show();
                panel1.Controls.Add(working_Data);
                working_Data.BringToFront();
            }
            break;

            case "Data":
            {
                MVS_Controller.Working_data working_Data = new MVS_Controller.Working_data(this, panel1);
                string[] text = null;
                Controller.Create_new_Nod(name_main, "Data", working_Data, ref text);
                working_Data.label.Text = name_vis;
                working_Data.Show();
                panel1.Controls.Add(working_Data);
                working_Data.BringToFront();
            }
            break;
            }
        }