Esempio n. 1
0
        public void Run(bool startAllWorker = false)
        {
            consoleStandardOutput.Clear();

            Stopwatch watch = new Stopwatch();

            watch.Start();

            if (startAllWorker)
            {
                Consoles.ForEach(c => c.Workers.ForEach(w => w.Start()));
            }

            if (Consoles.Count == 0)
            {
                throw new InvalidOperationException("Cannot run ConsoleAsync without at least one console");
            }

            while (isRunning)
            {
                input.Execute(ActiveConsole, watch.ElapsedMilliseconds);
                Renderer.Render(ActiveConsole);
                watch.Restart();
                ManageStandardOutput();
                Task.Delay(10).Wait();
            }
        }