Пример #1
0
        public override void ControlSetup(Statement name)
        {
            XmlLoop LoopName = (XmlLoop)name;

            comboBox1.SelectedIndex = LoopName.LoopType;
            List <String> vList = Util.GetVariableList(this, 0);

            this.comboBox4.Items.Clear();
            this.comboBox4.Items.AddRange(vList.ToArray());
            this.comboBox2.Items.Clear();
            this.comboBox2.Items.AddRange(vList.ToArray());
            comboBox2.SelectedItem  = LoopName.WhileValue;
            comboBox3.SelectedIndex = LoopName.WhileOperator;

            textBox1.Text     = LoopName.ForNumber;
            checkBox1.Checked = LoopName.Infintite;

            checkBox2.Checked = LoopName.Constant;
            if (LoopName.Constant)
            {
                comboBox4.Text = LoopName.WhileValue2;
            }
            else
            {
                comboBox4.SelectedItem = LoopName.WhileValue2;
            }
            statementBlock1.Open(LoopName.Block);
        }
Пример #2
0
        public override Statement CreateProgramDefine()
        {
            XmlLoop Loop = new XmlLoop();

            Loop.LoopType      = comboBox1.SelectedIndex;
            Loop.WhileValue    = comboBox2.Text;
            Loop.WhileValue2   = comboBox4.Text;
            Loop.WhileOperator = comboBox3.SelectedIndex;
            Loop.ForNumber     = textBox1.Text;
            Loop.Constant      = checkBox2.Checked;
            Loop.Infintite     = checkBox1.Checked;
            Loop.Block         = statementBlock1.CreateProgramDefine();
            return(Loop);
        }