Ejemplo n.º 1
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            if (_current != null)
            {
                Out.T.Text = "";
                StreamWriter writer        = _current.ParentList.ConsoleWriter;
                TextWriter   oldConsoleOut = Console.Out;
                Console.SetOut(writer);
                MemoryStream stream = (MemoryStream)writer.BaseStream;
                stream.SetLength(0);
                _current.Execute();
                writer.Flush();
                Console.SetOut(oldConsoleOut);
                Out.T.Text += writer.Encoding.GetString(stream.ToArray());

                Out.ShowDialog();
            }
        }
        public void RunAllTest()
        {
            frmOutput Out = new frmOutput();

            Out.T.Text = "";
            StreamWriter writer        = ConsoleWriter;
            TextWriter   oldConsoleOut = Console.Out;

            Console.SetOut(writer);
            MemoryStream stream = (MemoryStream)writer.BaseStream;

            stream.SetLength(0);
            foreach (TreeData _current in this)
            {
                _current.Execute();
            }
            writer.Flush();
            Console.SetOut(oldConsoleOut);
            Out.T.Text += writer.Encoding.GetString(stream.ToArray());
            Out.ShowDialog();
        }