mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-18 21:08:15 +08:00
Updating documentation output to match new Exception rendering.
This commit is contained in:

committed by
Patrik Svensson

parent
78958aae27
commit
e8eb5b85b9
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Spectre.Console;
|
||||
|
||||
namespace Generator.Commands
|
||||
@ -65,6 +66,11 @@ namespace Generator.Commands
|
||||
_input.Enqueue((new ConsoleKeyInfo((char)input, input, false, false, false), delay));
|
||||
}
|
||||
|
||||
public bool IsKeyAvailable()
|
||||
{
|
||||
return _input.Count > 0;
|
||||
}
|
||||
|
||||
public ConsoleKeyInfo? ReadKey(bool intercept)
|
||||
{
|
||||
if (_input.Count == 0)
|
||||
@ -77,5 +83,10 @@ namespace Generator.Commands
|
||||
Thread.Sleep(result.Item2);
|
||||
return result.Item1;
|
||||
}
|
||||
|
||||
public Task<ConsoleKeyInfo?> ReadKeyAsync(bool intercept, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(ReadKey(intercept));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user