diff options
author | Wouter Tinus <win.acme.simple@gmail.com> | 2020-02-14 08:12:43 +0100 |
---|---|---|
committer | Wouter Tinus <win.acme.simple@gmail.com> | 2020-02-14 08:12:43 +0100 |
commit | 599f8c7850cb7b376ecff73b3ab6a2826b82fb5e (patch) | |
tree | adba0e8618602736c9a8abb2abc3cb7188988b4f /src/main.lib/Services/InputService.cs | |
parent | 1ff397bbc044e8f01a2ff0a19ccf154f2d2b7f09 (diff) | |
download | letsencrypt-win-simple-599f8c7850cb7b376ecff73b3ab6a2826b82fb5e.zip letsencrypt-win-simple-599f8c7850cb7b376ecff73b3ab6a2826b82fb5e.tar.gz letsencrypt-win-simple-599f8c7850cb7b376ecff73b3ab6a2826b82fb5e.tar.bz2 |
quick select in renewal manager
Diffstat (limited to 'src/main.lib/Services/InputService.cs')
-rw-r--r-- | src/main.lib/Services/InputService.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.lib/Services/InputService.cs b/src/main.lib/Services/InputService.cs index 0dd4ed2..06416d3 100644 --- a/src/main.lib/Services/InputService.cs +++ b/src/main.lib/Services/InputService.cs @@ -339,7 +339,7 @@ namespace PKISharp.WACS.Services /// Print a (paged) list of choices for the user to choose from /// </summary> /// <param name="choices"></param> - public async Task<T> ChooseFromMenu<T>(string what, List<Choice<T>> choices) + public async Task<T> ChooseFromMenu<T>(string what, List<Choice<T>> choices, Func<string, Choice<T>>? unexpected = null) { if (!choices.Any()) { @@ -379,6 +379,11 @@ namespace PKISharp.WACS.Services _log.Warning($"The option you have chosen is currently disabled. {disabledReason}"); selected = null; } + + if (selected == null && unexpected != null) + { + selected = unexpected(choice); + } } } while (selected == null); return selected.Item; |