public override void ControlSetup(Statement name) { 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()); XmlCondition ConName = (XmlCondition)name; comboBox1.SelectedIndex = ConName.ConditionType; comboBox2.SelectedItem = ConName.Value1; statementBlock1.Open(ConName.Block1); checkBox2.Checked = ConName.UseElse; if (ConName.UseElse) { statementBlock2.Open(ConName.Block2); } checkBox1.Checked = ConName.Constant; if (ConName.Constant) { comboBox4.DropDownStyle = ComboBoxStyle.Simple; comboBox4.Text = ConName.Value2; } else { comboBox4.DropDownStyle = ComboBoxStyle.DropDownList; comboBox4.SelectedItem = ConName.Value2; } comboBox3.SelectedIndex = ConName.Opreater; }
public override Statement CreateProgramDefine() { XmlCondition Condition = new XmlCondition(); Condition.ConditionType = comboBox1.SelectedIndex; Condition.Value1 = comboBox2.Text; Condition.Value2 = comboBox4.Text; Condition.UseElse = checkBox1.Checked; Condition.Constant = checkBox2.Checked; Condition.Opreater = comboBox3.SelectedIndex; Condition.Block1 = statementBlock1.CreateProgramDefine(); Condition.Block2 = statementBlock2.CreateProgramDefine(); return(Condition); }