mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-17 20:43:22 +08:00

Without specific overloads without the args string.format will get called even if it's not needed. This closes #309
71 lines
2.6 KiB
C#
71 lines
2.6 KiB
C#
using System;
|
|
|
|
namespace Spectre.Console
|
|
{
|
|
/// <summary>
|
|
/// A console capable of writing ANSI escape sequences.
|
|
/// </summary>
|
|
public static partial class AnsiConsole
|
|
{
|
|
/// <summary>
|
|
/// Writes the specified markup to the console.
|
|
/// </summary>
|
|
/// <param name="value">The value to write.</param>
|
|
public static void Markup(string value)
|
|
{
|
|
Console.Markup(value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Writes the specified markup to the console.
|
|
/// </summary>
|
|
/// <param name="format">A composite format string.</param>
|
|
/// <param name="args">An array of objects to write.</param>
|
|
public static void Markup(string format, params object[] args)
|
|
{
|
|
Console.Markup(format, args);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Writes the specified markup to the console.
|
|
/// </summary>
|
|
/// <param name="provider">An object that supplies culture-specific formatting information.</param>
|
|
/// <param name="format">A composite format string.</param>
|
|
/// <param name="args">An array of objects to write.</param>
|
|
public static void Markup(IFormatProvider provider, string format, params object[] args)
|
|
{
|
|
Console.Markup(provider, format, args);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Writes the specified markup, followed by the current line terminator, to the console.
|
|
/// </summary>
|
|
/// <param name="value">The value to write.</param>
|
|
public static void MarkupLine(string value)
|
|
{
|
|
Console.MarkupLine(value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Writes the specified markup, followed by the current line terminator, to the console.
|
|
/// </summary>
|
|
/// <param name="format">A composite format string.</param>
|
|
/// <param name="args">An array of objects to write.</param>
|
|
public static void MarkupLine(string format, params object[] args)
|
|
{
|
|
Console.MarkupLine(format, args);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Writes the specified markup, followed by the current line terminator, to the console.
|
|
/// </summary>
|
|
/// <param name="provider">An object that supplies culture-specific formatting information.</param>
|
|
/// <param name="format">A composite format string.</param>
|
|
/// <param name="args">An array of objects to write.</param>
|
|
public static void MarkupLine(IFormatProvider provider, string format, params object[] args)
|
|
{
|
|
Console.MarkupLine(provider, format, args);
|
|
}
|
|
}
|
|
}
|