Updating documentation output to match new Exception rendering.

This commit is contained in:
Phil Scott
2022-02-03 14:40:28 -05:00
committed by Patrik Svensson
parent 78958aae27
commit e8eb5b85b9
12 changed files with 36 additions and 25 deletions

View File

@ -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));
}
}
}