95 instantiations of InteractionInput
Aspire.Hosting (3)
ApplicationModel\ParameterResource.cs (1)
116var 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 (1)
290saveParameters = new InteractionInput
Aspire.Hosting.Azure (10)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (6)
160new InteractionInput 186new InteractionInput 259new InteractionInput 285new InteractionInput 356new InteractionInput 364new InteractionInput
Provisioning\Internal\RunModeProvisioningContextProvider.cs (4)
131inputs.Add(new InteractionInput 158inputs.Add(new InteractionInput 193inputs.Add(new InteractionInput 216inputs.Add(new InteractionInput
Aspire.Hosting.Azure.Tests (1)
AzureDeployerTests.cs (1)
548.WithCustomInput(p => new InteractionInput
Aspire.Hosting.Tests (47)
AddParameterTests.cs (3)
380.WithCustomInput(p => new InteractionInput 439.WithCustomInput(p => new InteractionInput 484.WithCustomInput(p => new InteractionInput
Dashboard\DashboardServiceTests.cs (2)
320new Aspire.Hosting.InteractionInput { Name = "Input", InputType = Aspire.Hosting.InputType.Text }); 367new Aspire.Hosting.InteractionInput { Name = "Input", InputType = Aspire.Hosting.InputType.Text, Label = "Input" });
InteractionServiceTests.cs (42)
278var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, }; 315var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, Required = true }; 338var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 361var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, AllowCustomChoice = true, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 382var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Number }; 405var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Boolean }; 438var input = new InteractionInput { Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength }; 470var input = new InteractionInput 490var input = new InteractionInput 508var input = new InteractionInput 543var input = new InteractionInput 559new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 560new InteractionInput { Name = "Password", Label = "Password", InputType = InputType.SecretText }, 561new InteractionInput { Name = "RememberMe", Label = "Remember Me", InputType = InputType.Boolean } 599new InteractionInput { Name = "UserName", Label = "User Name", InputType = InputType.Text }, 600new InteractionInput { Name = "EmailAddress", Label = "Email Address", InputType = InputType.Text }, 601new InteractionInput { Name = "Age", InputType = InputType.Number } 633new InteractionInput { Name = "ExplicitName", Label = "Explicit", InputType = InputType.Text }, 634new InteractionInput { Name = "GeneratedLabel", Label = "Generated Label", InputType = InputType.Text }, 635new InteractionInput { Name = "AnotherExplicit", Label = "Another", InputType = InputType.Text } 656new InteractionInput { Name = "Duplicate", Label = "First", InputType = InputType.Text }, 657new InteractionInput { Name = "Duplicate", Label = "Second", InputType = InputType.Text } 671new InteractionInput { Name = "Username", Label = "First", InputType = InputType.Text }, 672new InteractionInput { Name = "USERNAME", Label = "Second", InputType = InputType.Text } 686new InteractionInput { Name = "Input1", InputType = InputType.Text }, 687new InteractionInput { Name = "Input2", InputType = InputType.Text }, 688new InteractionInput { Name = "Input3", InputType = InputType.Text } 719new InteractionInput { Name = "SpecialInput", Label = "!@#$%^&*()", InputType = InputType.Text }, 720new InteractionInput { Name = "EmptyLabel", Label = "", InputType = InputType.Text }, 721new InteractionInput { Name = "WhitespaceLabel", Label = " ", InputType = InputType.Text } 756new InteractionInput { Name = "Valid", Label = "Valid", InputType = InputType.Text } 772new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 773new InteractionInput { Name = "Password", Label = "Password", InputType = InputType.SecretText } 826new InteractionInput 879new InteractionInput { Name = "Username", Label = "Username", InputType = InputType.Text }, 880new InteractionInput 934new InteractionInput { Name = "Email", Label = "Email", InputType = InputType.Text, Required = true }, 935new InteractionInput { Name = "Age", Label = "Age", InputType = InputType.Number, Required = true } 986new InteractionInput 1002new InteractionInput { Name = "Age", Label = "Age", InputType = InputType.Number, Required = true } 1019new InteractionInput 1035new 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)
46new InteractionInput 54new InteractionInput 62new InteractionInput 75new InteractionInput 130new InteractionInput 153new InteractionInput 168new InteractionInput 189new InteractionInput 203new InteractionInput 218new InteractionInput
Stress.AppHost (22)
InteractionCommands.cs (22)
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 }; 70var 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 }; 71var choiceWithLongContent = new InteractionInput 82var choiceCustomOptionsWithLongContent = new InteractionInput 141var dinnerInput = new InteractionInput 154var requirementsInput = new InteractionInput 193var dinnerInput = new InteractionInput 221var requirementsInput = new InteractionInput 234var numberOfPeopleInput = new InteractionInput { Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true }; 237new InteractionInput { Name = "Name", InputType = InputType.Text, Label = "Name", Placeholder = "Enter name", Required = true, MaxLength = 50 }, 238new InteractionInput { Name = "Password", InputType = InputType.SecretText, Label = "Password", Placeholder = "Enter password", Required = true, MaxLength = 20 }, 242new InteractionInput { Name = "RememberMe", InputType = InputType.Boolean, Label = "Remember me", Placeholder = "What does this do?", Required = true }, 279var predefinedOptionsInput = new InteractionInput 291var customChoiceInput = new InteractionInput 339var dynamicInput = new InteractionInput 349var dynamicCustomChoiceInput = new InteractionInput 360var dynamicTextInput = new InteractionInput 418var predefinedOptionsInput = new InteractionInput 430var customChoiceInput = new InteractionInput 448var dynamicInput = new InteractionInput 561inputs.Add(new InteractionInput
143 references to InteractionInput
Aspire.Hosting (51)
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 (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 (3)
276var resourceInputs = new List<(ParameterResource ParameterResource, InteractionInput Input)>(); 281var input = parameter.CreateInput(); 286InteractionInput? saveParameters = null;
ParameterResourceBuilderExtensions.cs (1)
194public static IResourceBuilder<ParameterResource> WithCustomInput(this IResourceBuilder<ParameterResource> builder, Func<ParameterResource, InteractionInput> createInput)
Pipelines\PipelineActivityReporter.cs (1)
387InteractionInput? matchingInput;
Aspire.Hosting.Azure (8)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (3)
200var tenantInput = validationContext.Inputs[TenantName]; 299var subscriptionInput = validationContext.Inputs[SubscriptionIdName]; 377var resourceGroupInput = validationContext.Inputs[ResourceGroupName];
Provisioning\Internal\RunModeProvisioningContextProvider.cs (5)
126var inputs = new List<InteractionInput>(); 234if (validationContext.Inputs.TryGetByName(TenantName, out var tenantInput)) 242var subscriptionInput = validationContext.Inputs[SubscriptionIdName]; 248var resourceGroupInput = validationContext.Inputs[ResourceGroupName]; 262if (result.Data.TryGetByName(TenantName, out var tenantInput))
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.DevTunnels.Tests (4)
DevTunnelCliInstallationManagerTests.cs (4)
56public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 61public Task<InteractionResult<InteractionInput>> PromptInputAsync(string title, string? message, InteractionInput input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default) 66public Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<InteractionInput> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (41)
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 (29)
278var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, }; 315var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, Required = true }; 338var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 361var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, AllowCustomChoice = true, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] }; 382var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Number }; 405var input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Boolean }; 438var input = new InteractionInput { Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength }; 470var input = new InteractionInput 490var input = new InteractionInput 508var input = new InteractionInput 543var input = new InteractionInput 557var inputs = new List<InteractionInput> 579Assert.True(collection.TryGetByName("Username", out var usernameInput)); 582Assert.False(collection.TryGetByName("NonExistent", out var nonExistentInput)); 597var inputs = new List<InteractionInput> 631var inputs = new List<InteractionInput> 654var inputs = new List<InteractionInput> 669var inputs = new List<InteractionInput> 684var inputs = new List<InteractionInput> 717var inputs = new List<InteractionInput> 754var inputs = new List<InteractionInput> 770var inputs = new List<InteractionInput> 824var inputs = new List<InteractionInput> 877var inputs = new List<InteractionInput> 932var inputs = new List<InteractionInput> 949var emailInput = context.Inputs["Email"]; 950var ageInput = context.Inputs["Age"]; 984var inputs = new List<InteractionInput> 1017var inputs = new List<InteractionInput>
Orchestrator\ParameterProcessorTests.cs (3)
433var param1Input = inputsInteraction.Inputs[0]; 439var param2Input = inputsInteraction.Inputs[1]; 473var 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 (3)
DistributedApplicationBuilderExtensions.cs (3)
87var dependsOnInput = c.AllInputs["SSLCertificateType"]; 102var appNameInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Name"); 108var versionInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Version");
Stress.AppHost (32)
InteractionCommands.cs (32)
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 }; 70var 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 }; 71var choiceWithLongContent = new InteractionInput 82var choiceCustomOptionsWithLongContent = new InteractionInput 115var input = context.Inputs[0]; 133var input = result.Data; 141var dinnerInput = new InteractionInput 154var requirementsInput = new InteractionInput 183foreach (var updatedInput in result.Data) 193var dinnerInput = new InteractionInput 221var requirementsInput = new InteractionInput 234var numberOfPeopleInput = new InteractionInput { Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true }; 235var inputs = new List<InteractionInput> 269foreach (var updatedInput in result.Data) 279var predefinedOptionsInput = new InteractionInput 291var customChoiceInput = new InteractionInput 318var dependsOnInput = context.AllInputs["PredefinedOptions"]; 339var dynamicInput = new InteractionInput 349var dynamicCustomChoiceInput = new InteractionInput 360var dynamicTextInput = new InteractionInput 373var dependsOnInput = context.AllInputs["Dynamic"]; 379var inputs = new List<InteractionInput> 408foreach (var updatedInput in result.Data) 418var predefinedOptionsInput = new InteractionInput 430var customChoiceInput = new InteractionInput 448var dynamicInput = new InteractionInput 461var dependsOnInput = context.AllInputs["PredefinedOptions"]; 480var inputs = new List<InteractionInput> 507foreach (var updatedInput in result.Data) 558var inputs = new List<InteractionInput>(); 583foreach (var input in result.Data)