95 instantiations of InteractionInput
Aspire.Hosting (3)
ApplicationModel\ParameterResource.cs (1)
116
var input = new
InteractionInput
InteractionService.cs (1)
108
return 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)
290
saveParameters = new
InteractionInput
Aspire.Hosting.Azure (10)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (6)
160
new
InteractionInput
186
new
InteractionInput
259
new
InteractionInput
285
new
InteractionInput
356
new
InteractionInput
364
new
InteractionInput
Provisioning\Internal\RunModeProvisioningContextProvider.cs (4)
131
inputs.Add(new
InteractionInput
158
inputs.Add(new
InteractionInput
193
inputs.Add(new
InteractionInput
216
inputs.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)
320
new Aspire.Hosting.
InteractionInput
{ Name = "Input", InputType = Aspire.Hosting.InputType.Text });
367
new Aspire.Hosting.
InteractionInput
{ Name = "Input", InputType = Aspire.Hosting.InputType.Text, Label = "Input" });
InteractionServiceTests.cs (42)
278
var input = new
InteractionInput
{ Name = "Value", Label = "Value", InputType = InputType.Text, };
315
var input = new
InteractionInput
{ Name = "Value", Label = "Value", InputType = InputType.Text, Required = true };
338
var input = new
InteractionInput
{ Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] };
361
var input = new
InteractionInput
{ Name = "Value", Label = "Value", InputType = InputType.Choice, AllowCustomChoice = true, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] };
382
var input = new
InteractionInput
{ Name = "Value", Label = "Value", InputType = InputType.Number };
405
var input = new
InteractionInput
{ Name = "Value", Label = "Value", InputType = InputType.Boolean };
438
var input = new
InteractionInput
{ Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength };
470
var input = new
InteractionInput
490
var input = new
InteractionInput
508
var input = new
InteractionInput
543
var input = new
InteractionInput
559
new
InteractionInput
{ Name = "Username", Label = "Username", InputType = InputType.Text },
560
new
InteractionInput
{ Name = "Password", Label = "Password", InputType = InputType.SecretText },
561
new
InteractionInput
{ Name = "RememberMe", Label = "Remember Me", InputType = InputType.Boolean }
599
new
InteractionInput
{ Name = "UserName", Label = "User Name", InputType = InputType.Text },
600
new
InteractionInput
{ Name = "EmailAddress", Label = "Email Address", InputType = InputType.Text },
601
new
InteractionInput
{ Name = "Age", InputType = InputType.Number }
633
new
InteractionInput
{ Name = "ExplicitName", Label = "Explicit", InputType = InputType.Text },
634
new
InteractionInput
{ Name = "GeneratedLabel", Label = "Generated Label", InputType = InputType.Text },
635
new
InteractionInput
{ Name = "AnotherExplicit", Label = "Another", InputType = InputType.Text }
656
new
InteractionInput
{ Name = "Duplicate", Label = "First", InputType = InputType.Text },
657
new
InteractionInput
{ Name = "Duplicate", Label = "Second", InputType = InputType.Text }
671
new
InteractionInput
{ Name = "Username", Label = "First", InputType = InputType.Text },
672
new
InteractionInput
{ Name = "USERNAME", Label = "Second", InputType = InputType.Text }
686
new
InteractionInput
{ Name = "Input1", InputType = InputType.Text },
687
new
InteractionInput
{ Name = "Input2", InputType = InputType.Text },
688
new
InteractionInput
{ Name = "Input3", InputType = InputType.Text }
719
new
InteractionInput
{ Name = "SpecialInput", Label = "!@#$%^&*()", InputType = InputType.Text },
720
new
InteractionInput
{ Name = "EmptyLabel", Label = "", InputType = InputType.Text },
721
new
InteractionInput
{ Name = "WhitespaceLabel", Label = " ", InputType = InputType.Text }
756
new
InteractionInput
{ Name = "Valid", Label = "Valid", InputType = InputType.Text }
772
new
InteractionInput
{ Name = "Username", Label = "Username", InputType = InputType.Text },
773
new
InteractionInput
{ Name = "Password", Label = "Password", InputType = InputType.SecretText }
826
new
InteractionInput
879
new
InteractionInput
{ Name = "Username", Label = "Username", InputType = InputType.Text },
880
new
InteractionInput
934
new
InteractionInput
{ Name = "Email", Label = "Email", InputType = InputType.Text, Required = true },
935
new
InteractionInput
{ Name = "Age", Label = "Age", InputType = InputType.Number, Required = true }
986
new
InteractionInput
1002
new
InteractionInput
{ Name = "Age", Label = "Age", InputType = InputType.Number, Required = true }
1019
new
InteractionInput
1035
new
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)
46
new
InteractionInput
54
new
InteractionInput
62
new
InteractionInput
75
new
InteractionInput
130
new
InteractionInput
153
new
InteractionInput
168
new
InteractionInput
189
new
InteractionInput
203
new
InteractionInput
218
new
InteractionInput
Stress.AppHost (22)
InteractionCommands.cs (22)
57
var 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." };
58
var 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 };
70
var 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 };
71
var choiceWithLongContent = new
InteractionInput
82
var choiceCustomOptionsWithLongContent = new
InteractionInput
141
var dinnerInput = new
InteractionInput
154
var requirementsInput = new
InteractionInput
193
var dinnerInput = new
InteractionInput
221
var requirementsInput = new
InteractionInput
234
var numberOfPeopleInput = new
InteractionInput
{ Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true };
237
new
InteractionInput
{ Name = "Name", InputType = InputType.Text, Label = "Name", Placeholder = "Enter name", Required = true, MaxLength = 50 },
238
new
InteractionInput
{ Name = "Password", InputType = InputType.SecretText, Label = "Password", Placeholder = "Enter password", Required = true, MaxLength = 20 },
242
new
InteractionInput
{ Name = "RememberMe", InputType = InputType.Boolean, Label = "Remember me", Placeholder = "What does this do?", Required = true },
279
var predefinedOptionsInput = new
InteractionInput
291
var customChoiceInput = new
InteractionInput
339
var dynamicInput = new
InteractionInput
349
var dynamicCustomChoiceInput = new
InteractionInput
360
var dynamicTextInput = new
InteractionInput
418
var predefinedOptionsInput = new
InteractionInput
430
var customChoiceInput = new
InteractionInput
448
var dynamicInput = new
InteractionInput
561
inputs.Add(new
InteractionInput
143 references to InteractionInput
Aspire.Hosting (51)
ApplicationModel\InputGeneratorAnnotation.cs (2)
13
public class InputGeneratorAnnotation(Func<ParameterResource,
InteractionInput
> inputGenerator) : IResourceAnnotation
18
public Func<ParameterResource,
InteractionInput
> InputGenerator => inputGenerator;
ApplicationModel\ParameterResource.cs (2)
108
internal
InteractionInput
CreateInput()
116
var
input = new InteractionInput
Dashboard\DashboardServiceData.cs (4)
196
var choiceInteractionsToUpdate = new HashSet<
InteractionInput
>();
201
if (!inputsInfo.Inputs.TryGetByName(requestInput.Name, out
var
modelInput))
225
foreach (
var
dependentInput in dependentInputs)
234
foreach (
var
inputToUpdate in choiceInteractionsToUpdate)
IInteractionService.cs (24)
62
Task<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
"/>.
75
Task<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>
88
Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<
InteractionInput
> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default);
106
InteractionInput
Input,
121
public Action<
InteractionInput
>? OnLoadComplete { get; init; }
237
public required
InteractionInput
Input { get; init; }
240
/// Gets the collection of all <see cref="
InteractionInput
"/> in this prompt.
352
public sealed class InteractionInputCollection : IReadOnlyList<
InteractionInput
>
354
private readonly List<
InteractionInput
> _inputs;
355
private readonly Dictionary<string,
InteractionInput
> _inputsByName;
361
public InteractionInputCollection(IReadOnlyList<
InteractionInput
> inputs)
363
var inputsByName = new Dictionary<string,
InteractionInput
>(StringComparers.InteractionInputName);
367
foreach (
var
input in inputs)
386
public
InteractionInput
this[string name]
390
if (_inputsByName.TryGetValue(name, out
var
input))
403
public
InteractionInput
this[int index] => _inputs[index];
416
public bool TryGetByName(string name, [NotNullWhen(true)] out
InteractionInput
? input)
440
public IEnumerator<
InteractionInput
> GetEnumerator() => _inputs.GetEnumerator();
448
internal int IndexOf(
InteractionInput
input) => _inputs.IndexOf(input);
452
/// Specifies the type of input for an <see cref="
InteractionInput
"/>.
522
public void AddValidationError(
InteractionInput
input, string errorMessage)
InteractionService.cs (14)
106
public async Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
111
public async Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message,
InteractionInput
input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
116
return InteractionResult.Cancel<
InteractionInput
>();
122
public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<
InteractionInput
> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
134
var
input = inputs[i];
143
if (!inputCollection.TryGetByName(dependsOnInputName, out
var
dependsOnInput))
145
throw new InvalidOperationException($"The input '{input.Name}' has {nameof(
InteractionInput
.DynamicLoading)} that depends on an input named '{dependsOnInputName}', but no such input exists.");
149
throw 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.");
167
foreach (
var
input in inputs)
209
return completion.State is not IReadOnlyList<
InteractionInput
> inputState
367
if (result.State is IReadOnlyList<
InteractionInput
> inputs)
369
foreach (
var
input in inputs)
381
foreach (
var
input in inputs)
Orchestrator\ParameterProcessor.cs (3)
276
var resourceInputs = new List<(ParameterResource ParameterResource,
InteractionInput
Input)>();
281
var
input = parameter.CreateInput();
286
InteractionInput
? saveParameters = null;
ParameterResourceBuilderExtensions.cs (1)
194
public static IResourceBuilder<ParameterResource> WithCustomInput(this IResourceBuilder<ParameterResource> builder, Func<ParameterResource,
InteractionInput
> createInput)
Pipelines\PipelineActivityReporter.cs (1)
387
InteractionInput
? matchingInput;
Aspire.Hosting.Azure (8)
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (3)
200
var
tenantInput = validationContext.Inputs[TenantName];
299
var
subscriptionInput = validationContext.Inputs[SubscriptionIdName];
377
var
resourceGroupInput = validationContext.Inputs[ResourceGroupName];
Provisioning\Internal\RunModeProvisioningContextProvider.cs (5)
126
var inputs = new List<
InteractionInput
>();
234
if (validationContext.Inputs.TryGetByName(TenantName, out
var
tenantInput))
242
var
subscriptionInput = validationContext.Inputs[SubscriptionIdName];
248
var
resourceGroupInput = validationContext.Inputs[ResourceGroupName];
262
if (result.Data.TryGetByName(TenantName, out
var
tenantInput))
Aspire.Hosting.Azure.Tests (4)
tests\Shared\TestInteractionService.cs (4)
23
public Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
28
public Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message,
InteractionInput
input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
33
public 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)
56
public Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
61
public Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message,
InteractionInput
input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
66
public Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<
InteractionInput
> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
Aspire.Hosting.Tests (41)
AddParameterTests.cs (5)
403
var
input = parameter.Resource.CreateInput();
422
var
input = parameter.Resource.CreateInput();
450
var
input = parameter.Resource.CreateInput();
469
var
input = parameter.Resource.CreateInput();
496
var
input = parameter.Resource.CreateInput();
InteractionServiceTests.cs (29)
278
var
input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, };
315
var
input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Text, Required = true };
338
var
input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] };
361
var
input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Choice, AllowCustomChoice = true, Options = [KeyValuePair.Create("first", "First option!"), KeyValuePair.Create("second", "Second option!")] };
382
var
input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Number };
405
var
input = new InteractionInput { Name = "Value", Label = "Value", InputType = InputType.Boolean };
438
var
input = new InteractionInput { Name = "Value", Label = "Value", InputType = inputType, MaxLength = maxLength };
470
var
input = new InteractionInput
490
var
input = new InteractionInput
508
var
input = new InteractionInput
543
var
input = new InteractionInput
557
var inputs = new List<
InteractionInput
>
579
Assert.True(collection.TryGetByName("Username", out
var
usernameInput));
582
Assert.False(collection.TryGetByName("NonExistent", out
var
nonExistentInput));
597
var inputs = new List<
InteractionInput
>
631
var inputs = new List<
InteractionInput
>
654
var inputs = new List<
InteractionInput
>
669
var inputs = new List<
InteractionInput
>
684
var inputs = new List<
InteractionInput
>
717
var inputs = new List<
InteractionInput
>
754
var inputs = new List<
InteractionInput
>
770
var inputs = new List<
InteractionInput
>
824
var inputs = new List<
InteractionInput
>
877
var inputs = new List<
InteractionInput
>
932
var inputs = new List<
InteractionInput
>
949
var
emailInput = context.Inputs["Email"];
950
var
ageInput = context.Inputs["Age"];
984
var inputs = new List<
InteractionInput
>
1017
var inputs = new List<
InteractionInput
>
Orchestrator\ParameterProcessorTests.cs (3)
433
var
param1Input = inputsInteraction.Inputs[0];
439
var
param2Input = inputsInteraction.Inputs[1];
473
var
secretInput = inputsInteraction.Inputs[0];
tests\Shared\TestInteractionService.cs (4)
23
public Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message, string inputLabel, string placeHolder, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
28
public Task<InteractionResult<
InteractionInput
>> PromptInputAsync(string title, string? message,
InteractionInput
input, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
33
public async Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(string title, string? message, IReadOnlyList<
InteractionInput
> inputs, InputsDialogInteractionOptions? options = null, CancellationToken cancellationToken = default)
Publishers.AppHost (3)
DistributedApplicationBuilderExtensions.cs (3)
87
var
dependsOnInput = c.AllInputs["SSLCertificateType"];
102
var
appNameInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Name");
108
var
versionInput = validationContext.Inputs.FirstOrDefault(i => i.Label == "Application Version");
Stress.AppHost (32)
InteractionCommands.cs (32)
57
var
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." };
58
var
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 };
70
var
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 };
71
var
choiceWithLongContent = new InteractionInput
82
var
choiceCustomOptionsWithLongContent = new InteractionInput
115
var
input = context.Inputs[0];
133
var
input = result.Data;
141
var
dinnerInput = new InteractionInput
154
var
requirementsInput = new InteractionInput
183
foreach (
var
updatedInput in result.Data)
193
var
dinnerInput = new InteractionInput
221
var
requirementsInput = new InteractionInput
234
var
numberOfPeopleInput = new InteractionInput { Name = "NumberOfPeople", InputType = InputType.Number, Label = "Number of people", Placeholder = "Enter number of people", Value = "2", Required = true };
235
var inputs = new List<
InteractionInput
>
269
foreach (
var
updatedInput in result.Data)
279
var
predefinedOptionsInput = new InteractionInput
291
var
customChoiceInput = new InteractionInput
318
var
dependsOnInput = context.AllInputs["PredefinedOptions"];
339
var
dynamicInput = new InteractionInput
349
var
dynamicCustomChoiceInput = new InteractionInput
360
var
dynamicTextInput = new InteractionInput
373
var
dependsOnInput = context.AllInputs["Dynamic"];
379
var inputs = new List<
InteractionInput
>
408
foreach (
var
updatedInput in result.Data)
418
var
predefinedOptionsInput = new InteractionInput
430
var
customChoiceInput = new InteractionInput
448
var
dynamicInput = new InteractionInput
461
var
dependsOnInput = context.AllInputs["PredefinedOptions"];
480
var inputs = new List<
InteractionInput
>
507
foreach (
var
updatedInput in result.Data)
558
var inputs = new List<
InteractionInput
>();
583
foreach (
var
input in result.Data)