Add console dimension properties to IConsole

Closes #90
This commit is contained in:
Oleksii Holub
2022-06-28 15:38:10 +03:00
parent ae1f03914c
commit 64cbdaaeab
4 changed files with 58 additions and 24 deletions

View File

@@ -41,7 +41,21 @@ public class SystemConsole : IConsole, IDisposable
get => Console.BackgroundColor;
set => Console.BackgroundColor = value;
}
/// <inheritdoc />
public int WindowWidth
{
get => Console.WindowWidth;
set => Console.WindowWidth = value;
}
/// <inheritdoc />
public int WindowHeight
{
get => Console.WindowHeight;
set => Console.WindowHeight = value;
}
/// <inheritdoc />
public int CursorLeft
{
@@ -66,15 +80,15 @@ public class SystemConsole : IConsole, IDisposable
Error = ConsoleWriter.Create(this, Console.OpenStandardError());
}
/// <inheritdoc />
public ConsoleKeyInfo ReadKey(bool intercept = false) => Console.ReadKey(intercept);
/// <inheritdoc />
public void ResetColor() => Console.ResetColor();
/// <inheritdoc />
public ConsoleKeyInfo ReadKey(bool intercept = false) => Console.ReadKey(intercept);
/// <inheritdoc />
public void Clear() => Console.Clear();
/// <inheritdoc />
public CancellationToken RegisterCancellationHandler()
{
@@ -95,7 +109,7 @@ public class SystemConsole : IConsole, IDisposable
return (_cancellationTokenSource = cts).Token;
}
/// <inheritdoc />
public void Dispose()
{