23 instantiations of SelectionChoiceGroup
aspire (3)
Commands\AddCommand.cs (1)
940
var group = new
SelectionChoiceGroup
(GetSourceIdentity(package), name);
Commands\NewCommand.cs (2)
387
var builtInGroup = new
SelectionChoiceGroup
("builtin", NewCommandStrings.BuiltInTemplates);
436
return
new
($"source:{template.SourceName}", name)
Aspire.Cli.Tests (20)
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (1)
121
Assert.Equal(new
SelectionChoiceGroup
("source:company", displayName ?? "company")
Commands\NewCommandLocalTemplateTests.ConfiguredSources.cs (4)
377
[new
SelectionChoiceGroup
("source:first-source", "Company [templates]") { Style = new Style(Color.Green) },
378
new
SelectionChoiceGroup
("source:second-source", "Company [templates]") { Style = new Style(Color.Green) }],
382
Assert.Equal(new
SelectionChoiceGroup
("builtin", NewCommandStrings.BuiltInTemplates), choice.Group));
447
Assert.Equal(new
SelectionChoiceGroup
("source:company", "company") { Style = new Style(Color.Green) },
Commands\NewCommandLocalTemplateTests.InitConfig.cs (2)
221
[new
SelectionChoiceGroup
("source:enterprise", "Team [templates]") { Style = new Style(Color.Green) },
222
new
SelectionChoiceGroup
("source:personal", "Team [templates]") { Style = new Style(Color.Green) }],
Interaction\ConsoleInteractionServiceTests.cs (12)
349
"built-in" =>
new
("builtin", "Built-in templates"),
350
"first" =>
new
("source:first", "Company [first]"),
351
"second" =>
new
("source:second", "Company [second]"),
381
choice => choice.Id == "search" ? null : new
SelectionChoiceGroup
(choice.Id, "Same heading"),
400
?
new
("source:first", "First source")
401
: new
SelectionChoiceGroup
("source:second", "Second source"), choice => choice.Display);
418
_ => new
SelectionChoiceGroup
("choices", "Choices"), choice => choice.ToString())
433
choice => new
SelectionChoiceGroup
(choice.Id, "Source"), choice => choice.Display);
447
template => new
SelectionChoiceGroup
(template.Name, template.Name),
488
_ => new
SelectionChoiceGroup
("source", "Company [source]\r\nwith a long heading that must fit"),
533
_ => new
SelectionChoiceGroup
("source", "Company"), template => NewCommand.FormatTemplateDisplayLabel(template).EscapeMarkup());
551
template => new
SelectionChoiceGroup
(template.Name, template.Name),
Interaction\ExtensionInteractionServiceTests.cs (1)
455
return new
SelectionChoiceGroup
(choice.Label, "Source");
12 references to SelectionChoiceGroup
aspire (10)
Commands\AddCommand.cs (2)
933
private static
SelectionChoiceGroup
GetSourceGroup((string FriendlyName, NuGetPackage Package, PackageChannel Channel) package)
940
var
group = new SelectionChoiceGroup(GetSourceIdentity(package), name);
Commands\NewCommand.cs (3)
387
var
builtInGroup = new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates);
433
internal static
SelectionChoiceGroup
CreateTemplateSourceGroup(ConfiguredTemplate template)
896
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