23 instantiations of SelectionChoiceGroup
aspire (3)
Commands\AddCommand.cs (1)
940var group = new SelectionChoiceGroup(GetSourceIdentity(package), name);
Commands\NewCommand.cs (2)
387var builtInGroup = new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates); 436return new($"source:{template.SourceName}", name)
Aspire.Cli.Tests (20)
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (1)
121Assert.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) }, 378new SelectionChoiceGroup("source:second-source", "Company [templates]") { Style = new Style(Color.Green) }], 382Assert.Equal(new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates), choice.Group)); 447Assert.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) }, 222new 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]"), 381choice => 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()) 433choice => new SelectionChoiceGroup(choice.Id, "Source"), choice => choice.Display); 447template => 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()); 551template => new SelectionChoiceGroup(template.Name, template.Name),
Interaction\ExtensionInteractionServiceTests.cs (1)
455return new SelectionChoiceGroup(choice.Label, "Source");
12 references to SelectionChoiceGroup
aspire (10)
Commands\AddCommand.cs (2)
933private static SelectionChoiceGroup GetSourceGroup((string FriendlyName, NuGetPackage Package, PackageChannel Channel) package) 940var group = new SelectionChoiceGroup(GetSourceIdentity(package), name);
Commands\NewCommand.cs (3)
387var builtInGroup = new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates); 433internal static SelectionChoiceGroup CreateTemplateSourceGroup(ConfiguredTemplate template) 896private sealed record TemplateChoice(string Label, ITemplate Template, bool IsConfigured, SelectionChoiceGroup Group);
Interaction\ConsoleInteractionService.cs (3)
289public 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 292private 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 372var group = choiceGroup(choice);
Interaction\ExtensionInteractionService.cs (1)
309Func<T, SelectionChoiceGroup?> choiceGroup, Func<T, string> groupedChoiceFormatter, PromptBinding<string?>? binding = null, bool echoSelected = true, CancellationToken cancellationToken = default) where T : notnull
Interaction\IInteractionService.cs (1)
32Task<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)
52public List<IReadOnlyList<(string Label, SelectionChoiceGroup? Group, string DisplayLabel)>> GroupedSelectionPromptCalls { get; } = []; 172public 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