Class ConsoleExtensions
Helper methods for IConsole.
Inheritance
Namespace: McMaster.Extensions.CommandLineUtils
Assembly: McMaster.Extensions.CommandLineUtils.dll
Syntax
public static class ConsoleExtensions
Methods
| Improve this Doc View SourceWrite(IConsole, Boolean)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, bool value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Boolean | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Char)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, char value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Char | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Char[])
Formats and writes an array of characters.
Declaration
public static IConsole Write(this IConsole console, char[] buffer)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Char[] | buffer | The buffer. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Char[], Int32, Int32)
Formats and writes a portion of a character buffer.
Declaration
public static IConsole Write(this IConsole console, char[] buffer, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Char[] | buffer | The buffer. |
System.Int32 | index | The start index. |
System.Int32 | count | The number of characters to write. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Decimal)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, decimal value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Decimal | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Double)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, double value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Double | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Int32)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, int value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Int64)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, long value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Object)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, object value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Object | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, Single)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, float value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Single | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, String)
Writes a string console output.
Declaration
public static IConsole Write(this IConsole console, string value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | value | The value. |
Returns
Type | Description |
---|---|
IConsole | the console. |
Write(IConsole, String, Object)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, string format, object arg0)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object | arg0 | The first argument to replace in the format string. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, String, Object, Object)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, string format, object arg0, object arg1)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object | arg0 | The first argument to replace in the format string. |
System.Object | arg1 | The second argument to replace in the format string. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, String, Object, Object, Object)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, string format, object arg0, object arg1, object arg2)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object | arg0 | The first argument to replace in the format string. |
System.Object | arg1 | The second argument to replace in the format string. |
System.Object | arg2 | The third argument to replace in the format string. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, String, Object[])
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, string format, params object[] arg)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object[] | arg | Argument used to format. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, UInt32)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, uint value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.UInt32 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
Write(IConsole, UInt64)
Formats and writes a value.
Declaration
public static IConsole Write(this IConsole console, ulong value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.UInt64 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole)
Writes an empty line.
Declaration
public static IConsole WriteLine(this IConsole console)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
Returns
Type | Description |
---|---|
IConsole | the console. |
WriteLine(IConsole, Boolean)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, bool value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Boolean | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Char)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, char value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Char | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Char[])
Formats and writes an array of characters as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, char[] buffer)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Char[] | buffer | The buffer. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Char[], Int32, Int32)
Formats and writes a portion of a character buffer as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, char[] buffer, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Char[] | buffer | The buffer. |
System.Int32 | index | The start index. |
System.Int32 | count | The number of characters to write. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Decimal)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, decimal value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Decimal | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Double)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, double value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Double | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Int32)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, int value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Int64)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, long value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Int64 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Object)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, object value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Object | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, Single)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, float value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.Single | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, String)
Writes a string followed by a line terminator.
Declaration
public static IConsole WriteLine(this IConsole console, string value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | value | The value. |
Returns
Type | Description |
---|---|
IConsole | the console. |
WriteLine(IConsole, String, Object)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, string format, object arg0)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object | arg0 | The first argument to replace in the format string. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, String, Object, Object)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, string format, object arg0, object arg1)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object | arg0 | The first argument to replace in the format string. |
System.Object | arg1 | The second argument to replace in the format string. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, String, Object, Object, Object)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, string format, object arg0, object arg1, object arg2)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object | arg0 | The first argument to replace in the format string. |
System.Object | arg1 | The second argument to replace in the format string. |
System.Object | arg2 | The third argument to replace in the format string. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, String, Object[])
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, string format, params object[] arg)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.String | format | The format string. |
System.Object[] | arg | Argument used to format. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, UInt32)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, uint value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.UInt32 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |
WriteLine(IConsole, UInt64)
Formats and writes a value as a new line.
Declaration
public static IConsole WriteLine(this IConsole console, ulong value)
Parameters
Type | Name | Description |
---|---|---|
IConsole | console | The console. |
System.UInt64 | value | The value. |
Returns
Type | Description |
---|---|
IConsole | The console. |