void ButtonCompoundClick(object sender, EventArgs e) { Statement firstStatement = null; Statement secondStatement = null; using (StatementForm sf = new StatementForm("First Compound Statement")) { if (sf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { firstStatement = sf.getStatement(); using (StatementForm sf2 = new StatementForm("Second Compound")) { if (sf2.ShowDialog() == System.Windows.Forms.DialogResult.OK) { secondStatement = sf2.getStatement(); } } } } CompoundStatement cs = new CompoundStatement(); cs.setS1(firstStatement); cs.setS2(secondStatement); this.stmt = cs; finished(); }
void ButtonAddStatementClick(object sender, EventArgs e) { using (StatementForm sf = new StatementForm("choose Statement")) { if (sf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ti.addStatement(sf.getStatement(), 1); } } }
void ButtonForkClick(object sender, EventArgs e) { Statement st = null; using (StatementForm sf = new StatementForm("Fork's Statement")) { if (sf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { st = sf.getStatement(); } } ForkStatement fs = new ForkStatement(); fs.setS(st); this.stmt = fs; finished(); }
void ButtonIfClick(object sender, EventArgs e) { Expression exp = null; using (ExpressionForm expF = new ExpressionForm("IF's Expression")) { if (expF.ShowDialog() == System.Windows.Forms.DialogResult.OK) { exp = expF.getExpression(); } } Statement firstStatement = null; Statement secondStatement = null; using (StatementForm sf = new StatementForm("First IF Statement")) { if (sf.ShowDialog() == System.Windows.Forms.DialogResult.OK) { firstStatement = sf.getStatement(); using (StatementForm sf2 = new StatementForm("Second IF Statement")) { if (sf2.ShowDialog() == System.Windows.Forms.DialogResult.OK) { secondStatement = sf2.getStatement(); } } } } IfStatement ifS = new IfStatement(); ifS.setE(exp); ifS.setS1(firstStatement); ifS.setS2(secondStatement); stmt = ifS; finished(); }