mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Add ReadKey to IConsole (#111)
Co-authored-by: Alexey Golub <tyrrrrrr@gmail.com>
This commit is contained in:
@@ -84,13 +84,18 @@ namespace CliFx.Infrastructure
|
|||||||
_cancellationTokenSource.Cancel();
|
_cancellationTokenSource.Cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public void ReadKey(bool intercept = false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual void Dispose() => _cancellationTokenSource.Dispose();
|
public virtual void Dispose() => _cancellationTokenSource.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,11 @@ namespace CliFx.Infrastructure
|
|||||||
/// Clears the console buffer and corresponding console window of display information.
|
/// Clears the console buffer and corresponding console window of display information.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtains the next character or function key pressed by the user.
|
||||||
|
/// </summary>
|
||||||
|
void ReadKey(bool intercept = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -131,4 +136,4 @@ namespace CliFx.Infrastructure
|
|||||||
console.WithBackgroundColor(backgroundColor)
|
console.WithBackgroundColor(backgroundColor)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,10 +89,13 @@ namespace CliFx.Infrastructure
|
|||||||
|
|
||||||
return (_cancellationTokenSource = cts).Token;
|
return (_cancellationTokenSource = cts).Token;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Clear() => Console.Clear();
|
public void Clear() => Console.Clear();
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public void ReadKey(bool intercept = false) => Console.ReadKey(intercept);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
@@ -103,4 +106,4 @@ namespace CliFx.Infrastructure
|
|||||||
Error.Dispose();
|
Error.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user