96 instantiations of InteractionInput
Aspire.Hosting (4)
ApplicationModel\ParameterResource.cs (1)
139var input = new InteractionInput
InteractionService.cs (1)
108return await PromptInputAsync(title, message, new InteractionInput { Name = InteractionHelpers.LabelToName(inputLabel), InputType = InputType.Text, Label = inputLabel, Required = true, Placeholder = placeHolder }, options, cancellationToken).ConfigureAwait(false);
Orchestrator\ParameterProcessor.cs (2)
308return new InteractionInput 347deleteFromUserSecretsInput = new InteractionInput
Aspire.Hosting.Azure (10)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (6)
159new InteractionInput 185new InteractionInput 258new InteractionInput 284new InteractionInput 352var resourceGroupInput = new InteractionInput 450new InteractionInput
Provisioning\Internal\RunModeProvisioningContextProvider.cs (4)
131inputs.Add(new InteractionInput 182inputs.Add(new InteractionInput 196inputs.Add(new InteractionInput 233inputs.Add(new InteractionInput
Aspire.Hosting.Azure.Tests (1)
AzureDeployerTests.cs (1)
632.WithCustomInput(p => new InteractionInput
Aspire.Hosting.Tests (47)
AddParameterTests.cs (3)
381.WithCustomInput(p => new InteractionInput 440.WithCustomInput(p => new InteractionInput 485.WithCustomInput(p => new InteractionInput
Dashboard\DashboardServiceTests.cs (2)
321new Aspire.Hosting.InteractionInput { Name = "Input", InputType = Aspire.Hosting.InputType.Text }); 368new Aspire.Hosting.InteractionInput { Name = "Input", InputType = Aspire.Hosting.InputType.Text, Label = "Input" });
InteractionServiceTests.cs (42)
279var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, }; 316var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, Required = true }; 339var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 362var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, AllowCustomChoice = true, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 383var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Number }; 406var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Boolean }; 439var input = new InteractionInput { Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength }; 471var input = new InteractionInput 491var input = new InteractionInput 509var input = new InteractionInput 544var input = new InteractionInput 560new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 561new InteractionInput { Name = "Password", Label = "Password", InputType = InputType.SecretText }, 562new InteractionInput { Name = "RememberMe", Label = "Remember Me", InputType = InputType.Boolean } 600new InteractionInput { Name = "UserName", Label = "User Name", InputType = InputType.Text }, 601new InteractionInput { Name = "EmailAddress", Label = "Email Address", InputType = InputType.Text }, 602new InteractionInput { Name = "Age", InputType = InputType.Number } 634new InteractionInput { Name = "ExplicitName", Label = "Explicit", InputType = InputType.Text }, 635new InteractionInput { Name = "GeneratedLabel", Label = "Generated Label", InputType = InputType.Text }, 636new InteractionInput { Name = "AnotherExplicit", Label = "Another", InputType = InputType.Text } 657new InteractionInput { Name = "Duplicate", Label = "First", InputType = InputType.Text }, 658new InteractionInput { Name = "Duplicate", Label = "Second", InputType = InputType.Text } 672new InteractionInput { Name = "Username", Label = "First", InputType = InputType.Text }, 673new InteractionInput { Name = "USERNAME", Label = "Second", InputType = InputType.Text } 687new InteractionInput { Name = "Input1", InputType = InputType.Text }, 688new InteractionInput { Name = "Input2", InputType = InputType.Text }, 689new InteractionInput { Name = "Input3", InputType = InputType.Text } 720new InteractionInput { Name = "SpecialInput", Label = "!@#$%^&*()", InputType = InputType.Text }, 721new InteractionInput { Name = "EmptyLabel", Label = "", InputType = InputType.Text }, 722new InteractionInput { Name = "WhitespaceLabel", Label = " ", InputType = InputType.Text } 757new InteractionInput { Name = "Valid", Label = "Valid", InputType = InputType.Text } 773new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 774new InteractionInput { Name = "Password", Label = "Password", InputType = InputType.SecretText } 827new InteractionInput 880new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 881new InteractionInput 935new InteractionInput { Name = "Email", Label = "Email", InputType = InputType.Text, Required = true }, 936new InteractionInput { Name = "Age", Label = "Age", InputType = InputType.Number, Required = true } 987new InteractionInput 1003new InteractionInput { Name = "Age", Label = "Age", InputType = InputType.Number, Required = true } 1020new InteractionInput 1036new 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 (10)
DistributedApplicationBuilderExtensions.cs (10)
47new InteractionInput 55new InteractionInput 63new InteractionInput 76new InteractionInput 131new InteractionInput 154new InteractionInput 169new InteractionInput 190new InteractionInput 204new InteractionInput 219new InteractionInput
Stress.AppHost (22)
InteractionCommands.cs (22)
58var 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." }; 59var 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 }; 71var 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.", EnableDescriptionMarkdown = true }; 72var choiceWithLongContent = new InteractionInput 83var choiceCustomOptionsWithLongContent = new InteractionInput 142var dinnerInput = new InteractionInput 155var requirementsInput = new InteractionInput 194var dinnerInput = new InteractionInput 222var requirementsInput = new InteractionInput 235var numberOfPeopleInput = new InteractionInput { Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true }; 238new InteractionInput { Name = "Name", InputType = InputType.Text, Label = "Name", Placeholder = "Enter name", Required = true, MaxLength = 50 }, 239new InteractionInput { Name = "Password", InputType = InputType.SecretText, Label = "Password", Placeholder = "Enter password", Required = true, MaxLength = 20 }, 243new InteractionInput { Name = "RememberMe", InputType = InputType.Boolean, Label = "Remember me", Placeholder = "What does this do?", Required = true }, 280var predefinedOptionsInput = new InteractionInput 292var customChoiceInput = new InteractionInput 340var dynamicInput = new InteractionInput 350var dynamicCustomChoiceInput = new InteractionInput 361var dynamicTextInput = new InteractionInput 419var predefinedOptionsInput = new InteractionInput 431var customChoiceInput = new InteractionInput 449var dynamicInput = new InteractionInput 562inputs.Add(new InteractionInput
161 references to InteractionInput
Aspire.Hosting (57)
ApplicationModel\InputGeneratorAnnotation.cs (2)
13public class InputGeneratorAnnotation(Func<ParameterResource, InteractionInput> inputGenerator) : IResourceAnnotation 18public Func<ParameterResource, InteractionInput> InputGenerator => inputGenerator;
ApplicationModel\ParameterResource.cs (2)
131internal InteractionInput CreateInput() 139var input = new InteractionInput
Dashboard\DashboardServiceData.cs (4)
196var choiceInteractionsToUpdate = new HashSet<InteractionInput>(); 201if (!inputsInfo.Inputs.TryGetByName(requestInput.Name, out var modelInput)) 225foreach (var dependentInput in dependentInputs) 234foreach (var inputToUpdate in choiceInteractionsToUpdate)
IInteractionService.cs (24)
62Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default); 65/// Prompts the user for a single input using a specified <see cref="InteractionInput"/>. 75Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default); 82/// <param name="inputs">A collection of <see cref="InteractionInput"/> to prompt for.</param> 88Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default); 106InteractionInput Input, 121public Action<InteractionInput>? OnLoadComplete { get; init; } 237public required InteractionInput Input { get; init; } 240/// Gets the collection of all <see cref="InteractionInput"/> in this prompt. 352public sealed class InteractionInputCollection : IReadOnlyList<InteractionInput> 354private readonly List<InteractionInput> _inputs; 355private readonly Dictionary<string, InteractionInput> _inputsByName; 361public InteractionInputCollection(IReadOnlyList<InteractionInput> inputs) 363var inputsByName = new Dictionary<string, InteractionInput>(StringComparers.InteractionInputName); 367foreach (var input in inputs) 386public InteractionInput this[string name] 390if (_inputsByName.TryGetValue(name, out var input)) 403public InteractionInput this[int index] => _inputs[index]; 416public bool TryGetByName(string name, [NotNullWhen(true)] out InteractionInput? input) 440public IEnumerator<InteractionInput> GetEnumerator() => _inputs.GetEnumerator(); 448internal int IndexOf(InteractionInput input) => _inputs.IndexOf(input); 452/// Specifies the type of input for an <see cref="InteractionInput"/>. 522public void AddValidationError(InteractionInput input, string errorMessage)
InteractionService.cs (14)
106public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 111public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 116return InteractionResult.Cancel<InteractionInput>(); 122public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 134var input = inputs[i]; 143if (!inputCollection.TryGetByName(dependsOnInputName, out var dependsOnInput)) 145throw new InvalidOperationException($"The input '{input.Name}' has {nameof(InteractionInput.DynamicLoading)} that depends on an input named '{dependsOnInputName}', but no such input exists."); 149throw new InvalidOperationException($"The input '{input.Name}' has {nameof(InteractionInput.DynamicLoading)} that depends on an input named '{dependsOnInputName}', but that input is not defined before it. Inputs must be defined in order so that dependencies are always to earlier inputs."); 167foreach (var input in inputs) 209return completion.State is not IReadOnlyList<InteractionInput> inputState 367if (result.State is IReadOnlyList<InteractionInput> inputs) 369foreach (var input in inputs) 381foreach (var input in inputs)
Orchestrator\ParameterProcessor.cs (9)
251var input = parameterResource.CreateInput(); 270var saveParameterInput = CreateSaveParameterInput(hasSavedState); 272var inputs = new List<InteractionInput> { input, saveParameterInput }; 306private InteractionInput CreateSaveParameterInput(bool hasExistingValue) 341var inputs = new List<InteractionInput>(); 342InteractionInput? deleteFromUserSecretsInput = null; 483var resourceInputs = new List<(ParameterResource ParameterResource, InteractionInput Input)>(); 488var input = parameter.CreateInput(); 493InteractionInput? saveParameters = null;
ParameterResourceBuilderExtensions.cs (1)
208public static IResourceBuilder<ParameterResource> WithCustomInput(this IResourceBuilder<ParameterResource> builder, Func<ParameterResource, InteractionInput> createInput)
Pipelines\PipelineActivityReporter.cs (1)
407InteractionInput? matchingInput;
Aspire.Hosting.Azure (9)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (4)
199var tenantInput = validationContext.Inputs[TenantName]; 298var subscriptionInput = validationContext.Inputs[SubscriptionIdName]; 352var resourceGroupInput = new InteractionInput 374var resourceGroupInput = validationContext.Inputs[ResourceGroupName];
Provisioning\Internal\RunModeProvisioningContextProvider.cs (5)
126var inputs = new List<InteractionInput>(); 283if (validationContext.Inputs.TryGetByName(TenantName, out var tenantInput)) 291var subscriptionInput = validationContext.Inputs[SubscriptionIdName]; 297var resourceGroupInput = validationContext.Inputs[ResourceGroupName]; 311if (result.Data.TryGetByName(TenantName, out var tenantInput))
Aspire.Hosting.Azure.Tests (14)
AzureDeployerTests.cs (3)
1611var apiKeyInput = parameterInputs.Inputs["api-key"]; 1612var dbInput = parameterInputs.Inputs["mydb"]; 1613var customInput = parameterInputs.Inputs["custom-setting"];
ProvisioningContextProviderTests.cs (6)
595var subscriptionInput = inputsInteraction.Inputs[BaseProvisioningContextProvider.SubscriptionIdName]; 603var resourceGroupInput = inputsInteraction.Inputs[BaseProvisioningContextProvider.ResourceGroupName]; 642var subscriptionInput = inputsInteraction.Inputs[BaseProvisioningContextProvider.SubscriptionIdName]; 689var subscriptionInput = inputsInteraction.Inputs[BaseProvisioningContextProvider.SubscriptionIdName]; 745var subscriptionInput = inputsInteraction.Inputs[BaseProvisioningContextProvider.SubscriptionIdName]; 789var resourceGroupInput = inputsInteraction.Inputs[BaseProvisioningContextProvider.ResourceGroupName];
tests\Shared\TestInteractionService.cs (5)
23public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 28public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 32var result = (InteractionResult<InteractionInput>)await data.CompletionTcs.Task; 36public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (46)
AddParameterTests.cs (5)
404var input = parameter.Resource.CreateInput(); 423var input = parameter.Resource.CreateInput(); 451var input = parameter.Resource.CreateInput(); 470var input = parameter.Resource.CreateInput(); 497var input = parameter.Resource.CreateInput();
InteractionServiceTests.cs (29)
279var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, }; 316var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, Required = true }; 339var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 362var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, AllowCustomChoice = true, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 383var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Number }; 406var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Boolean }; 439var input = new InteractionInput { Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength }; 471var input = new InteractionInput 491var input = new InteractionInput 509var input = new InteractionInput 544var input = new InteractionInput 558var inputs = new List<InteractionInput> 580Assert.True(collection.TryGetByName("Username", out var usernameInput)); 583Assert.False(collection.TryGetByName("NonExistent", out var nonExistentInput)); 598var inputs = new List<InteractionInput> 632var inputs = new List<InteractionInput> 655var inputs = new List<InteractionInput> 670var inputs = new List<InteractionInput> 685var inputs = new List<InteractionInput> 718var inputs = new List<InteractionInput> 755var inputs = new List<InteractionInput> 771var inputs = new List<InteractionInput> 825var inputs = new List<InteractionInput> 878var inputs = new List<InteractionInput> 933var inputs = new List<InteractionInput> 950var emailInput = context.Inputs["Email"]; 951var ageInput = context.Inputs["Age"]; 985var inputs = new List<InteractionInput> 1018var inputs = new List<InteractionInput>
Orchestrator\ParameterProcessorTests.cs (7)
445var param1Input = inputsInteraction.Inputs["param1"]; 451var param2Input = inputsInteraction.Inputs["param2"]; 488var secretInput = inputsInteraction.Inputs["secretParam"]; 523var paramInput = inputsInteraction.Inputs["param1"]; 526var saveCheckbox = inputsInteraction.Inputs[ParameterProcessor.SaveToUserSecretsName]; 562var paramInput = inputsInteraction.Inputs["param1"]; 565var saveCheckbox = inputsInteraction.Inputs[ParameterProcessor.SaveToUserSecretsName];
tests\Shared\TestInteractionService.cs (5)
23public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 28public async Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 32var result = (InteractionResult<InteractionInput>)await data.CompletionTcs.Task; 36public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
Publishers.AppHost (3)
DistributedApplicationBuilderExtensions.cs (3)
88var dependsOnInput = c.AllInputs["SSLCertificateType"]; 103var appNameInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Name"); 109var versionInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Version");
Stress.AppHost (32)
InteractionCommands.cs (32)
58var 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." }; 59var 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 }; 71var 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.", EnableDescriptionMarkdown = true }; 72var choiceWithLongContent = new InteractionInput 83var choiceCustomOptionsWithLongContent = new InteractionInput 116var input = context.Inputs[0]; 134var input = result.Data; 142var dinnerInput = new InteractionInput 155var requirementsInput = new InteractionInput 184foreach (var updatedInput in result.Data) 194var dinnerInput = new InteractionInput 222var requirementsInput = new InteractionInput 235var numberOfPeopleInput = new InteractionInput { Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true }; 236var inputs = new List<InteractionInput> 270foreach (var updatedInput in result.Data) 280var predefinedOptionsInput = new InteractionInput 292var customChoiceInput = new InteractionInput 319var dependsOnInput = context.AllInputs["PredefinedOptions"]; 340var dynamicInput = new InteractionInput 350var dynamicCustomChoiceInput = new InteractionInput 361var dynamicTextInput = new InteractionInput 374var dependsOnInput = context.AllInputs["Dynamic"]; 380var inputs = new List<InteractionInput> 409foreach (var updatedInput in result.Data) 419var predefinedOptionsInput = new InteractionInput 431var customChoiceInput = new InteractionInput 449var dynamicInput = new InteractionInput 462var dependsOnInput = context.AllInputs["PredefinedOptions"]; 481var inputs = new List<InteractionInput> 508foreach (var updatedInput in result.Data) 559var inputs = new List<InteractionInput>(); 584foreach (var input in result.Data)