4 instantiations of Interaction
Aspire.Hosting (4)
InteractionService.cs (4)
132var newState = new Interaction(title, message, options, new Interaction.MessageBoxInteractionInfo(intent: options.Intent ?? MessageIntent.None), interactionCts.Token); 206var newState = new Interaction(title, message, options, new Interaction.InputsInteractionInfo(inputCollection), interactionCts.Token); 285var newState = new Interaction(title, message, options, new Interaction.NotificationInteractionInfo(intent: options.Intent ?? MessageIntent.None, linkText: options.LinkText, linkUrl: options.LinkUrl, relatedResourceNames: options.RelatedResourceNames ?? []), interactionCts.Token); 352var newState = new Interaction(title, message, options, interactionInfo, interactionCts.Token);
112 references to Interaction
Aspire.Hosting (48)
Dashboard\DashboardService.cs (2)
15using static Aspire.Hosting.Interaction; 104await foreach (var interaction in updates.WithCancellation(cts.Token).ConfigureAwait(false))
Dashboard\DashboardServiceData.cs (5)
155internal IAsyncEnumerable<Interaction> SubscribeInteractionUpdates() 214if (interaction.InteractionInfo is not Interaction.TerminalInteractionInfo terminal || 221var inputsInfo = (Interaction.InputsInteractionInfo)interaction.InteractionInfo; 252Interaction.InputsInteractionInfo inputsInfo, 308public static void ProcessInputs(IServiceProvider serviceProvider, ILogger logger, Interaction.InputsInteractionInfo inputsInfo, List<InputDto> inputDtos, bool dependencyChange, CancellationToken cancellationToken)
InteractionService.cs (34)
27private Action<Interaction>? OnInteractionUpdated { get; set; } 132var newState = new Interaction(title, message, options, new Interaction.MessageBoxInteractionInfo(intent: options.Intent ?? MessageIntent.None), interactionCts.Token); 206var newState = new Interaction(title, message, options, new Interaction.InputsInteractionInfo(inputCollection), interactionCts.Token); 285var newState = new Interaction(title, message, options, new Interaction.NotificationInteractionInfo(intent: options.Intent ?? MessageIntent.None, linkText: options.LinkText, linkUrl: options.LinkUrl, relatedResourceNames: options.RelatedResourceNames ?? []), interactionCts.Token); 306options.Title ?? string.Empty, message, options, new Interaction.ProgressInteractionInfo(), 336options.Title ?? string.Empty, message, options, new Interaction.TerminalInteractionInfo(terminal.Id), 342string title, string message, InteractionOptions options, Interaction.InteractionInfoBase interactionInfo, 352var newState = new Interaction(title, message, options, interactionInfo, interactionCts.Token); 418private void CompleteWorkInteraction(Interaction interaction, InteractionCompletionState completion) 448internal List<Interaction> GetCurrentInteractions() 458var interactionState = (Interaction)newState!; 472private void AddInteractionUpdate(Interaction interactionUpdate) 478if (interactionUpdate.State == Interaction.InteractionState.Complete) 506internal void UpdateInteraction(Interaction interaction) 511if (!_interactionCollection.TryGetValue(interaction.InteractionId, out var interactionState)) 521internal async Task ProcessInteractionFromClientAsync(int interactionId, Func<Interaction, IServiceProvider, ILogger, InteractionCompletionState> createResult, CancellationToken cancellationToken) 523Interaction? interactionState = null; 563private void CompleteInteractionCore(Interaction interactionState, InteractionCompletionState completion) 567if (interactionState.InteractionInfo is Interaction.InputsInteractionInfo inputsInfo && 580interactionState.State = Interaction.InteractionState.Complete; 592private async Task<bool> RunValidationAsync(Interaction interactionState, InteractionCompletionState result, CancellationToken cancellationToken) 594if (result.Complete && interactionState.InteractionInfo is Interaction.InputsInteractionInfo inputsInfo) 696internal async IAsyncEnumerable<Interaction> SubscribeInteractionUpdates([EnumeratorCancellation] CancellationToken cancellationToken = default) 698var channel = Channel.CreateUnbounded<Interaction>(); 700void WriteToChannel(Interaction resourceEvent) => 703List<Interaction> pendingInteractions; 712foreach (var interaction in pendingInteractions) 719await foreach (var item in channel.Reader.ReadAllAsync(cancellationToken).ConfigureAwait(false)) 744internal class InteractionCollection : KeyedCollection<int, Interaction> 746protected override int GetKeyForItem(Interaction item) => item.InteractionId;
Pipelines\PipelineActivityReporter.cs (7)
314await foreach (var interaction in _interactionService.SubscribeInteractionUpdates(cancellationToken).ConfigureAwait(false)) 325private async Task WriteInteractionUpdateToClientAsync(Interaction interaction, CancellationToken cancellationToken) 327if (interaction.State == Interaction.InteractionState.InProgress) 329if (interaction.InteractionInfo is Interaction.InputsInteractionInfo inputsInfo && inputsInfo.Inputs.Count > 0) 370else if (interaction.InteractionInfo is Interaction.NotificationInteractionInfo) 410if (interaction.InteractionInfo is Interaction.InputsInteractionInfo inputsInfo) 456else if (interaction.InteractionInfo is Interaction.NotificationInteractionInfo)
Aspire.Hosting.Tests (64)
Dashboard\DashboardServiceTests.cs (4)
696var interaction = Assert.Single(interactions.GetCurrentInteractions()); 1243var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1282var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1347var interaction = Assert.Single(interactionService.GetCurrentInteractions());
InteractionServiceTests.cs (47)
30var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 32Assert.Equal(Interaction.InteractionState.InProgress, interaction.State); 55var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 57Assert.Equal(Interaction.InteractionState.InProgress, interaction.State); 126var updates = Channel.CreateUnbounded<Interaction>(); 129await foreach (var interaction in subscription.WithCancellation(CancellationToken.None)) 137var interaction1 = Assert.Single(interactionService.GetCurrentInteractions()); 142var interaction2 = interactionService.GetCurrentInteractions()[1]; 150var completedInteraction1 = await updates.Reader.ReadAsync().DefaultTimeout(); 158var completedInteraction2 = await updates.Reader.ReadAsync().DefaultTimeout(); 480var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 482Assert.Equal(Interaction.InteractionState.InProgress, interaction.State); 506var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 529var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 552var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 573var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 596var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 629var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 966var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1003var updates = Channel.CreateUnbounded<Interaction>(); 1006await foreach (var interaction in subscription.WithCancellation(CancellationToken.None)) 1033var interaction = await updates.Reader.ReadAsync().DefaultTimeout(); 1034var inputsInteractionInfo = (Interaction.InputsInteractionInfo)interaction.InteractionInfo; 1043inputsInteractionInfo = (Interaction.InputsInteractionInfo)interaction.InteractionInfo; 1056var updates = Channel.CreateUnbounded<Interaction>(); 1059await foreach (var interaction in subscription.WithCancellation(CancellationToken.None)) 1088var interaction = await updates.Reader.ReadAsync().DefaultTimeout(); 1089var inputsInteractionInfo = (Interaction.InputsInteractionInfo)interaction.InteractionInfo; 1102inputsInteractionInfo = (Interaction.InputsInteractionInfo)interaction.InteractionInfo; 1109inputsInteractionInfo = (Interaction.InputsInteractionInfo)interaction.InteractionInfo; 1149var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1277var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1313var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1363var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1364Assert.Equal(Interaction.InteractionState.InProgress, interaction.State); 1386var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1404var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1407Assert.IsType<Interaction.ProgressInteractionInfo>(interaction.InteractionInfo); 1419if (interaction.InteractionInfo is Interaction.InputsInteractionInfo inputsInfo) 1460var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1488var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1513var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1532var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1556var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1580var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1603var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1632var interaction = Assert.Single(interactionService.GetCurrentInteractions());
ResourceCommandServiceTests.cs (2)
1372var interaction = Assert.Single(interactionService.GetCurrentInteractions()); 1373var inputs = Assert.IsType<Interaction.InputsInteractionInfo>(interaction.InteractionInfo).Inputs;
Terminals\InteractionServiceTerminalTests.cs (11)
120var interaction = Assert.Single(service.GetCurrentInteractions()); 164var interaction = Assert.Single(service.GetCurrentInteractions()); 165Assert.Equal(terminal.Id, Assert.IsType<Interaction.TerminalInteractionInfo>(interaction.InteractionInfo).TerminalId); 207var interaction = Assert.Single(service.GetCurrentInteractions()); 243var interaction = Assert.Single(service.GetCurrentInteractions()); 292Assert.Equal(Interaction.InteractionState.InProgress, updates.Current.State); 308var interaction = updates.Current; 324Assert.Equal(Interaction.InteractionState.Complete, updates.Current.State); 333Assert.Equal(Interaction.InteractionState.InProgress, updates.Current.State); 371var interaction = Assert.Single(service.GetCurrentInteractions()); 402var interaction = Assert.Single(service.GetCurrentInteractions());