Exemple #1
0
        private static StandardStreamWriter WrapOutput(IConsole console, Stream?stream, bool isRedirected)
        {
            if (stream is null)
            {
                return(StandardStreamWriter.CreateNull(console));
            }

            return(new StandardStreamWriter(Stream.Synchronized(stream), Console.OutputEncoding, isRedirected, console)
            {
                AutoFlush = true
            });
        }