/// <summary>
        /// .ctor
        /// </summary>
        /// <param name="listener">object that implements <see cref="IConsoleTraceListener"/>
        /// which will receive callbacks for each line of output intercepted</param>
        public ConsoleOutInterceptor(IConsoleTraceListener listener)
        {
            outWriter     = new LineTextWriter(OnConsole);
            errorWriter   = new LineTextWriter(OnError);
            this.listener = listener;

            Console.SetOut(outWriter);
            Console.SetError(errorWriter);
        }
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                outWriter?.Dispose();
                errorWriter?.Dispose();

                outWriter   = null;
                errorWriter = null;
            }
        }