mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00

committed by
Phil Scott

parent
884cb8ddd4
commit
5f97f2300c
@ -2,6 +2,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Spectre.Console.Rendering;
|
||||
|
||||
namespace Spectre.Console
|
||||
@ -85,10 +87,16 @@ namespace Spectre.Console
|
||||
|
||||
/// <inheritdoc/>
|
||||
public List<T> Show(IAnsiConsole console)
|
||||
{
|
||||
return ShowAsync(console, CancellationToken.None).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<List<T>> ShowAsync(IAnsiConsole console, CancellationToken cancellationToken)
|
||||
{
|
||||
// Create the list prompt
|
||||
var prompt = new ListPrompt<T>(console, this);
|
||||
var result = prompt.Show(Tree, PageSize);
|
||||
var result = await prompt.Show(Tree, cancellationToken, PageSize).ConfigureAwait(false);
|
||||
|
||||
if (Mode == SelectionMode.Leaf)
|
||||
{
|
||||
|
Reference in New Issue
Block a user