23 instantiations of SelectionChoiceGroup
aspire (2)
Commands\NewCommand.cs (2)
370var builtInGroup = new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates); 411return new($"source:{template.SourceName}", $"{name} ({location})")
Aspire.Cli.Tests (21)
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (1)
53Assert.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) }, 341new SelectionChoiceGroup("source:second-source", $"Company [templates] ({Path.Combine(workspace.Path, "second")})") { Style = new Style(Color.Green) }], 345Assert.Equal(new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates), choice.Group)); 376Assert.Equal(new SelectionChoiceGroup("source:company", $"company ({Path.Combine(workspace.Path, "template")})") { Style = new Style(Color.Green) }, 400Assert.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) }, 167new 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]"), 88choice => 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()) 140choice => new SelectionChoiceGroup(choice.Id, "Source"), choice => choice.Display); 154template => 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()); 258template => new SelectionChoiceGroup(template.Name, template.Name),
Interaction\ExtensionInteractionServiceTests.cs (1)
446return new SelectionChoiceGroup(choice.Label, "Source");
10 references to SelectionChoiceGroup
aspire (8)
Commands\NewCommand.cs (3)
370var builtInGroup = new SelectionChoiceGroup("builtin", NewCommandStrings.BuiltInTemplates); 401internal static SelectionChoiceGroup CreateTemplateSourceGroup(ConfiguredTemplate template) 876private 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