Exemplo n.º 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();
        }
Exemplo n.º 2
0
        private Statement readCS()
        {
            CompoundStatement cs = new CompoundStatement();

            Console.WriteLine("Input first statement");
            cs.setS1(readStatement());
            Console.WriteLine("Input second statement");
            cs.setS2(readStatement());
            return(cs);
        }