mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
30 lines
525 B
C#
30 lines
525 B
C#
using System.IO;
|
|
|
|
namespace Spectre.Console;
|
|
|
|
internal static class TextWriterExtensions
|
|
{
|
|
public static bool IsStandardOut(this TextWriter writer)
|
|
{
|
|
try
|
|
{
|
|
return writer == System.Console.Out;
|
|
}
|
|
catch
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool IsStandardError(this TextWriter writer)
|
|
{
|
|
try
|
|
{
|
|
return writer == System.Console.Error;
|
|
}
|
|
catch
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
} |