Search Results for

    Show / Hide Table of Contents

    Class ConsoleReporter

    A thread-safe reporter that forwards to console output.

    Inheritance
    System.Object
    ConsoleReporter
    Implements
    IReporter
    Namespace: McMaster.Extensions.CommandLineUtils
    Assembly: McMaster.Extensions.CommandLineUtils.dll
    Syntax
    public class ConsoleReporter : IReporter

    Constructors

    | Improve this Doc View Source

    ConsoleReporter(IConsole)

    Initializes an instance of ConsoleReporter.

    Declaration
    public ConsoleReporter(IConsole console)
    Parameters
    Type Name Description
    IConsole console
    | Improve this Doc View Source

    ConsoleReporter(IConsole, Boolean, Boolean)

    Initializes an instance of ConsoleReporter.

    Declaration
    public ConsoleReporter(IConsole console, bool verbose, bool quiet)
    Parameters
    Type Name Description
    IConsole console
    System.Boolean verbose

    When false, Verbose does not display output.

    System.Boolean quiet

    When true, only Warn and Error display output

    Properties

    | Improve this Doc View Source

    Console

    The console to write to.

    Declaration
    protected IConsole Console { get; }
    Property Value
    Type Description
    IConsole
    | Improve this Doc View Source

    IsQuiet

    Is verbose output and regular output hidden.

    Declaration
    public bool IsQuiet { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsVerbose

    Is verbose output displayed.

    Declaration
    public bool IsVerbose { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    Error(String)

    Writes a message in System.ConsoleColor.Red to Error.

    Declaration
    public virtual void Error(string message)
    Parameters
    Type Name Description
    System.String message
    | Improve this Doc View Source

    Output(String)

    Writes a message to Out.

    Declaration
    public virtual void Output(string message)
    Parameters
    Type Name Description
    System.String message
    | Improve this Doc View Source

    Verbose(String)

    Writes a message in System.ConsoleColor.DarkGray to Out.

    Declaration
    public virtual void Verbose(string message)
    Parameters
    Type Name Description
    System.String message
    | Improve this Doc View Source

    Warn(String)

    Writes a message in System.ConsoleColor.Yellow to Out.

    Declaration
    public virtual void Warn(string message)
    Parameters
    Type Name Description
    System.String message
    | Improve this Doc View Source

    WriteLine(TextWriter, String, Nullable<ConsoleColor>, Nullable<ConsoleColor>)

    Write a line with color.

    Declaration
    protected virtual void WriteLine(TextWriter writer, string message, ConsoleColor? foregroundColor, ConsoleColor? backgroundColor = default(ConsoleColor? ))
    Parameters
    Type Name Description
    System.IO.TextWriter writer
    System.String message
    System.Nullable<System.ConsoleColor> foregroundColor
    System.Nullable<System.ConsoleColor> backgroundColor

    Implements

    IReporter
    • Improve this Doc
    • View Source
    In This Article
    Back to top