mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00

Also refactors the code quite a bit, to make it a bit more easier to add features like this in the future. Closes #75
28 lines
636 B
C#
28 lines
636 B
C#
using System.Text;
|
|
|
|
namespace Spectre.Console.Tests
|
|
{
|
|
public sealed class ConsoleWithWidth : IAnsiConsole
|
|
{
|
|
private readonly IAnsiConsole _console;
|
|
|
|
public Capabilities Capabilities => _console.Capabilities;
|
|
|
|
public int Width { get; }
|
|
public int Height => _console.Height;
|
|
|
|
public Encoding Encoding => _console.Encoding;
|
|
|
|
public ConsoleWithWidth(IAnsiConsole console, int width)
|
|
{
|
|
_console = console;
|
|
Width = width;
|
|
}
|
|
|
|
public void Write(string text, Style style)
|
|
{
|
|
_console.Write(text, style);
|
|
}
|
|
}
|
|
}
|