23 instantiations of SelectionChoiceGroup
aspire (2)
Commands\NewCommand.cs (2)
370
var builtInGroup = new
SelectionChoiceGroup
("builtin", NewCommandStrings.BuiltInTemplates);
411
return
new
($"source:{template.SourceName}", $"{name} ({location})")
Aspire.Cli.Tests (21)
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (1)
53
Assert.Equal(new
SelectionChoiceGroup
("source:company",
Commands\NewCommandLocalTemplateTests.ConfiguredSources.cs (5)
340
[new
SelectionChoiceGroup
("source:first-source", $"Company [templates] ({Path.Combine(workspace.Path, "first")})") { Style = new Style(Color.Green) },
341
new
SelectionChoiceGroup
("source:second-source", $"Company [templates] ({Path.Combine(workspace.Path, "second")})") { Style = new Style(Color.Green) }],
345
Assert.Equal(new
SelectionChoiceGroup
("builtin", NewCommandStrings.BuiltInTemplates), choice.Group));
376
Assert.Equal(new
SelectionChoiceGroup
("source:company", $"company ({Path.Combine(workspace.Path, "template")})") { Style = new Style(Color.Green) },
400
Assert.Equal(new
SelectionChoiceGroup
("builtin", NewCommandStrings.BuiltInTemplates), choice.Group));
Commands\NewCommandLocalTemplateTests.InitConfig.cs (2)
166
[new
SelectionChoiceGroup
("source:enterprise", $"Team [templates] ({Path.Combine(workspace.Path, "enterprise")})") { Style = new Style(Color.Green) },
167
new
SelectionChoiceGroup
("source:personal", $"Team [templates] ({Path.Combine(workspace.Path, "personal")})") { Style = new Style(Color.Green) }],
Interaction\ConsoleInteractionServiceTests.cs (12)
56
"built-in" =>
new
("builtin", "Built-in templates"),
57
"first" =>
new
("source:first", "Company [first]"),
58
"second" =>
new
("source:second", "Company [second]"),
88
choice => choice.Id == "search" ? null : new
SelectionChoiceGroup
(choice.Id, "Same heading"),
107
?
new
("source:first", "First source")
108
: new
SelectionChoiceGroup
("source:second", "Second source"), choice => choice.Display);
125
_ => new
SelectionChoiceGroup
("choices", "Choices"), choice => choice.ToString())
140
choice => new
SelectionChoiceGroup
(choice.Id, "Source"), choice => choice.Display);
154
template => new
SelectionChoiceGroup
(template.Name, template.Name),
195
_ => new
SelectionChoiceGroup
("source", "Company [source]\r\nwith a long heading that must fit"),
240
_ => new
SelectionChoiceGroup
("source", "Company"), template => NewCommand.FormatTemplateDisplayLabel(template).EscapeMarkup());
258
template => new
SelectionChoiceGroup
(template.Name, template.Name),
Interaction\ExtensionInteractionServiceTests.cs (1)
446
return new
SelectionChoiceGroup
(choice.Label, "Source");
10 references to SelectionChoiceGroup
aspire (8)
Commands\NewCommand.cs (3)
370
var
builtInGroup = new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates);
401
internal static
SelectionChoiceGroup
CreateTemplateSourceGroup(ConfiguredTemplate template)
876
private sealed record TemplateChoice(string Label, ITemplate Template, bool IsConfigured,
SelectionChoiceGroup
Group);
Interaction\ConsoleInteractionService.cs (3)
289
public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, Func<T,
SelectionChoiceGroup
?> choiceGroup, Func<T, string> groupedChoiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
292
private async Task<T> PromptForSelectionCoreAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, Func<T,
SelectionChoiceGroup
?>? choiceGroup, Func<T, string> groupedChoiceFormatter, PromptBinding<string?>? binding, bool echoSelected, CancellationToken cancellationToken) where T : notnull
372
var
group = choiceGroup(choice);
Interaction\ExtensionInteractionService.cs (1)
309
Func<T,
SelectionChoiceGroup
?> choiceGroup, Func<T, string> groupedChoiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
Interaction\IInteractionService.cs (1)
32
Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, Func<T,
SelectionChoiceGroup
?> choiceGroup, Func<T, string> groupedChoiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
Aspire.Cli.Tests (2)
TestServices\TestInteractionService.cs (2)
52
public List<IReadOnlyList<(string Label,
SelectionChoiceGroup
? Group, string DisplayLabel)>> GroupedSelectionPromptCalls { get; } = [];
172
public Task<T> PromptForSelectionAsync<T>(string promptText, IEnumerable<T> choices, Func<T, string> choiceFormatter, Func<T,
SelectionChoiceGroup
?> choiceGroup, Func<T, string> groupedChoiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull