ConsoleHelper
Provides helper methods for writing colored messages to the console and reading secure passwords.
Métodos
public static void ConsoleError(string message)
ConsoleHelper.ConsoleError(message)
Writes an error message to the console using the predefined error color.
- message
- The error message to write.
public static void ConsoleError(Exception ex)
ConsoleHelper.ConsoleError(ex)
Writes an exception to the console using the predefined error color.
- ex
- The exception to write.
public static void ConsoleInfo(string message)
ConsoleHelper.ConsoleInfo(message)
Writes an information message to the console.
- message
- The message to write.
public static void ConsoleSuccess(string message)
ConsoleHelper.ConsoleSuccess(message)
Writes a success message to the console using the predefined success color.
- message
- The success message to write.
public static void ConsoleWarning(string message)
ConsoleHelper.ConsoleWarning(message)
Writes a warning message to the console using the predefined warning color.
- message
- The warning message to write.
public static void ConsoleWithColor(string message, ConsoleColor color)
ConsoleHelper.ConsoleWithColor(message, color)
Writes a message to the console with the specified color.
- message
- The message to write.
- color
- The color to use for the message.
public static void ConsoleWithColor(Action handler, ConsoleColor color)
ConsoleHelper.ConsoleWithColor(handler, color)
Executes the provided action while displaying console output in the specified color.
- handler
- The action to execute.
- color
- The color to use for the console output.
public static SecureString ReadPassword()
result = ConsoleHelper.ReadPassword()
Reads a password from the console without displaying it, outputting a masked version.
Retorna: A SecureString that contains the password.
Campos
public static ConsoleColor Error
value = ConsoleHelper.Error
Gets or sets the color used to display error messages.
public static ConsoleColor Info
value = ConsoleHelper.Info
Gets or sets the color used to display information messages.
public static ConsoleColor Success
value = ConsoleHelper.Success
Gets or sets the color used to display success messages.
public static ConsoleColor Warning
value = ConsoleHelper.Warning
Gets or sets the color used to display warning messages.