mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00
32 lines
628 B
C#
32 lines
628 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;
|
|
}
|
|
}
|
|
}
|
|
}
|