mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00
parent
1fc6f22ea9
commit
2fe2bb3c32
@ -66,5 +66,13 @@ namespace Spectre.Console
|
|||||||
var factory = new AnsiConsoleFactory();
|
var factory = new AnsiConsoleFactory();
|
||||||
return factory.Create(settings);
|
return factory.Create(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears the console.
|
||||||
|
/// </summary>
|
||||||
|
public static void Clear()
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,20 @@ namespace Spectre.Console
|
|||||||
return new Recorder(console);
|
return new Recorder(console);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears the console.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="console">The console to clear.</param>
|
||||||
|
public static void Clear(this IAnsiConsole console)
|
||||||
|
{
|
||||||
|
if (console is null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(console));
|
||||||
|
}
|
||||||
|
|
||||||
|
console.Clear(true);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes the specified string value to the console.
|
/// Writes the specified string value to the console.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user