64 instantiations of InteractionInput
Aspire.Hosting (3)
ApplicationModel\ParameterResource.cs (1)
116var input = new InteractionInput
InteractionService.cs (1)
77return await PromptInputAsync(title, message, new InteractionInput { Name = inputLabel, InputType = InputType.Text, Label = inputLabel, Required = true, Placeholder = placeHolder }, options, cancellationToken).ConfigureAwait(false);
Orchestrator\ParameterProcessor.cs (1)
152var saveParameters = new InteractionInput
Aspire.Hosting.Azure (3)
Provisioning\Internal\DefaultProvisioningContextProvider.cs (3)
108new InteractionInput { Name = LocationName, InputType = InputType.Choice, Label = AzureProvisioningStrings.LocationLabel, Placeholder = AzureProvisioningStrings.LocationPlaceholder, Required = true, Options = [..locations] }, 109new InteractionInput { Name = SubscriptionIdName, InputType = InputType.SecretText, Label = AzureProvisioningStrings.SubscriptionIdLabel, Placeholder = AzureProvisioningStrings.SubscriptionIdPlaceholder, Required = true }, 110new InteractionInput { Name = ResourceGroupName, InputType = InputType.Text, Label = AzureProvisioningStrings.ResourceGroupLabel, Value = GetDefaultResourceGroupName() },
Aspire.Hosting.Tests (39)
AddParameterTests.cs (3)
380.WithCustomInput(p => new InteractionInput 439.WithCustomInput(p => new InteractionInput 484.WithCustomInput(p => new InteractionInput
Dashboard\DashboardServiceTests.cs (2)
317new Aspire.Hosting.InteractionInput { Name = "Input", InputType = Aspire.Hosting.InputType.Text }); 363new Aspire.Hosting.InteractionInput { Name = "Input", InputType = Aspire.Hosting.InputType.Text, Label = "Input" });
InteractionServiceTests.cs (34)
178var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, }; 211var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, Required = true }; 230var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 250var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Number }; 270var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Boolean }; 300var input = new InteractionInput { Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength }; 328var input = new InteractionInput 348var input = new InteractionInput 366var input = new InteractionInput 401var input = new InteractionInput 417new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 418new InteractionInput { Name = "Password", Label = "Password", InputType = InputType.SecretText }, 419new InteractionInput { Name = "RememberMe", Label = "Remember Me", InputType = InputType.Boolean } 457new InteractionInput { Name = "UserName", Label = "User Name", InputType = InputType.Text }, 458new InteractionInput { Name = "EmailAddress", Label = "Email Address", InputType = InputType.Text }, 459new InteractionInput { Name = "Age", InputType = InputType.Number } 491new InteractionInput { Name = "ExplicitName", Label = "Explicit", InputType = InputType.Text }, 492new InteractionInput { Name = "GeneratedLabel", Label = "Generated Label", InputType = InputType.Text }, 493new InteractionInput { Name = "AnotherExplicit", Label = "Another", InputType = InputType.Text } 514new InteractionInput { Name = "Duplicate", Label = "First", InputType = InputType.Text }, 515new InteractionInput { Name = "Duplicate", Label = "Second", InputType = InputType.Text } 529new InteractionInput { Name = "Username", Label = "First", InputType = InputType.Text }, 530new InteractionInput { Name = "USERNAME", Label = "Second", InputType = InputType.Text } 544new InteractionInput { Name = "Input1", InputType = InputType.Text }, 545new InteractionInput { Name = "Input2", InputType = InputType.Text }, 546new InteractionInput { Name = "Input3", InputType = InputType.Text } 577new InteractionInput { Name = "SpecialInput", Label = "!@#$%^&*()", InputType = InputType.Text }, 578new InteractionInput { Name = "EmptyLabel", Label = "", InputType = InputType.Text }, 579new InteractionInput { Name = "WhitespaceLabel", Label = " ", InputType = InputType.Text } 614new InteractionInput { Name = "Valid", Label = "Valid", InputType = InputType.Text } 630new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 631new InteractionInput { Name = "Password", Label = "Password", InputType = InputType.SecretText } 669new InteractionInput { Name = "Email", Label = "Email", InputType = InputType.Text, Required = true }, 670new InteractionInput { Name = "Age", Label = "Age", InputType = InputType.Number, Required = true }
ExternalServices.AppHost (1)
AppHost.cs (1)
11.WithCustomInput(p => new()
ParameterEndToEnd.AppHost (1)
AppHost.cs (1)
46.WithCustomInput(p => new()
Publishers.AppHost (9)
DistributedApplicationBuilderExtensions.cs (9)
37new InteractionInput 45new InteractionInput 53new InteractionInput 99new InteractionInput 122new InteractionInput 137new InteractionInput 158new InteractionInput 172new InteractionInput 187new InteractionInput
Stress.AppHost (8)
InteractionCommands.cs (8)
57var inputNoMarkdown = new InteractionInput { Name = "Name", Label = "<strong>Name</strong>", InputType = InputType.Text, Placeholder = "Enter <strong>your</strong> name.", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, neque id efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui.\r\n\r\nFor more information about the `IInteractionService`, see https://learn.microsoft.com." }; 58var inputHasMarkdown = new InteractionInput { Name = "Name", Label = "<strong>Name</strong>", InputType = InputType.Text, Placeholder = "Enter <strong>your</strong> name.", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, neque id efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui.\r\n\r\nFor more information about the `IInteractionService`, see https://learn.microsoft.com.", EnableDescriptionMarkdown = true }; 104var dinnerInput = new InteractionInput 132var numberOfPeopleInput = new InteractionInput { Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true }; 135new InteractionInput { Name = "Name", InputType = InputType.Text, Label = "Name", Placeholder = "Enter name", Required = true, MaxLength = 50 }, 136new InteractionInput { Name = "Password", InputType = InputType.SecretText, Label = "Password", Placeholder = "Enter password", Required = true, MaxLength = 20 }, 139new InteractionInput { Name = "RememberMe", InputType = InputType.Boolean, Label = "Remember me", Placeholder = "What does this do?", Required = true }, 220inputs.Add(new InteractionInput
91 references to InteractionInput
Aspire.Hosting (37)
ApplicationModel\InputGeneratorAnnotation.cs (2)
13public class InputGeneratorAnnotation(Func<ParameterResource, InteractionInput> inputGenerator) : IResourceAnnotation 18public Func<ParameterResource, InteractionInput> InputGenerator => inputGenerator;
ApplicationModel\ParameterResource.cs (2)
108internal InteractionInput CreateInput() 116var input = new InteractionInput
Dashboard\DashboardServiceData.cs (1)
173var modelInput = inputsInfo.Inputs[i];
IInteractionService.cs (19)
61Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default); 64/// Prompts the user for a single input using a specified <see cref="InteractionInput"/>. 74Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default); 81/// <param name="inputs">A collection of <see cref="InteractionInput"/> to prompt for.</param> 87Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default); 181public sealed class InteractionInputCollection : IReadOnlyList<InteractionInput> 183private readonly IReadOnlyList<InteractionInput> _inputs; 184private readonly IReadOnlyDictionary<string, InteractionInput> _inputsByName; 190public InteractionInputCollection(IReadOnlyList<InteractionInput> inputs) 192var inputsByName = new Dictionary<string, InteractionInput>(StringComparer.OrdinalIgnoreCase); 196foreach (var input in inputs) 215public InteractionInput this[string name] 219if (_inputsByName.TryGetValue(name, out var input)) 232public InteractionInput this[int index] => _inputs[index]; 245public bool TryGetByName(string name, [NotNullWhen(true)] out InteractionInput? input) 269public IEnumerator<InteractionInput> GetEnumerator() => _inputs.GetEnumerator(); 279/// Specifies the type of input for an <see cref="InteractionInput"/>. 348public void AddValidationError(InteractionInput input, string errorMessage)
InteractionService.cs (9)
75public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 80public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 85return InteractionResult.Cancel<InteractionInput>(); 91public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 108var inputState = completion.State as IReadOnlyList<InteractionInput>; 239if (result.State is IReadOnlyList<InteractionInput> inputs) 241foreach (var input in inputs) 253foreach (var input in inputs)
Orchestrator\ParameterProcessor.cs (3)
143var resourceInputs = new List<(ParameterResource ParameterResource, InteractionInput Input)>(); 148var input = parameter.CreateInput(); 152var saveParameters = new InteractionInput
ParameterResourceBuilderExtensions.cs (1)
194public static IResourceBuilder<ParameterResource> WithCustomInput(this IResourceBuilder<ParameterResource> builder, Func<ParameterResource, InteractionInput> createInput)
Aspire.Hosting.Azure (2)
Provisioning\Internal\DefaultProvisioningContextProvider.cs (2)
117var subscriptionInput = validationContext.Inputs[SubscriptionIdName]; 123var resourceGroupInput = validationContext.Inputs[ResourceGroupName];
Aspire.Hosting.Azure.Tests (4)
tests\Shared\TestInteractionService.cs (4)
23public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 28public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 33public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (36)
AddParameterTests.cs (5)
403var input = parameter.Resource.CreateInput(); 422var input = parameter.Resource.CreateInput(); 450var input = parameter.Resource.CreateInput(); 469var input = parameter.Resource.CreateInput(); 496var input = parameter.Resource.CreateInput();
InteractionServiceTests.cs (24)
178var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, }; 211var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, Required = true }; 230var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 250var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Number }; 270var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Boolean }; 300var input = new InteractionInput { Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength }; 328var input = new InteractionInput 348var input = new InteractionInput 366var input = new InteractionInput 401var input = new InteractionInput 415var inputs = new List<InteractionInput> 437Assert.True(collection.TryGetByName("Username", out var usernameInput)); 440Assert.False(collection.TryGetByName("NonExistent", out var nonExistentInput)); 455var inputs = new List<InteractionInput> 489var inputs = new List<InteractionInput> 512var inputs = new List<InteractionInput> 527var inputs = new List<InteractionInput> 542var inputs = new List<InteractionInput> 575var inputs = new List<InteractionInput> 612var inputs = new List<InteractionInput> 628var inputs = new List<InteractionInput> 667var inputs = new List<InteractionInput> 684var emailInput = context.Inputs["Email"]; 685var ageInput = context.Inputs["Age"];
Orchestrator\ParameterProcessorTests.cs (3)
431var param1Input = inputsInteraction.Inputs[0]; 437var param2Input = inputsInteraction.Inputs[1]; 471var secretInput = inputsInteraction.Inputs[0];
tests\Shared\TestInteractionService.cs (4)
23public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 28public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 33public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
Publishers.AppHost (2)
DistributedApplicationBuilderExtensions.cs (2)
71var appNameInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Name"); 77var versionInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Version");
Stress.AppHost (10)
InteractionCommands.cs (10)
57var inputNoMarkdown = new InteractionInput { Name = "Name", Label = "<strong>Name</strong>", InputType = InputType.Text, Placeholder = "Enter <strong>your</strong> name.", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, neque id efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui.\r\n\r\nFor more information about the `IInteractionService`, see https://learn.microsoft.com." }; 58var inputHasMarkdown = new InteractionInput { Name = "Name", Label = "<strong>Name</strong>", InputType = InputType.Text, Placeholder = "Enter <strong>your</strong> name.", Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce id massa arcu. Morbi ac risus eget augue venenatis hendrerit. Morbi posuere, neque id efficitur ultrices, velit augue suscipit ante, vitae lacinia elit risus nec dui.\r\n\r\nFor more information about the `IInteractionService`, see https://learn.microsoft.com.", EnableDescriptionMarkdown = true }; 78var input = context.Inputs[0]; 96var input = result.Data; 104var dinnerInput = new InteractionInput 132var numberOfPeopleInput = new InteractionInput { Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true }; 133var inputs = new List<InteractionInput> 166foreach (var updatedInput in result.Data) 217var inputs = new List<InteractionInput>(); 242foreach (var input in result.Data)