Esempio n. 1
0
 void ButtonExpressionClick(object sender, EventArgs e)
 {
     using (ExpressionForm expF = new ExpressionForm())
     {
         if (expF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.expression = expF.getExpression();
         }
     }
 }
Esempio n. 2
0
 void ButtonLeftExpressionClick(object sender, EventArgs e)
 {
     //PrintStatement ps = new PrintStatement();
     using (ExpressionForm expF = new ExpressionForm())
     {
         if (expF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.leftExpression = expF.getExpression();
         }
     }
 }
Esempio n. 3
0
        void ButtonPrintStatementClick(object sender, EventArgs e)
        {
            PrintStatement ps = new PrintStatement();

            using (ExpressionForm expF = new ExpressionForm())
            {
                if (expF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    ps.setE(expF.getExpression());
                    this.stmt = ps;
                    finished();
                }
            }
        }
Esempio n. 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();
        }