示例#1
0
        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();
        }
示例#2
0
 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);
         }
     }
 }
示例#3
0
        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();
        }
示例#4
0
        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();
        }