microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.Apps/Events/Topic.cs
20lines · modecode
| 1 | using Microsoft.Teams.Apps.Plugins; |
| 2 | |
| 3 | namespace Microsoft.Teams.Apps.Events; |
| 4 | |
| 5 | internal class Topic : List<Func<IPlugin, Event, CancellationToken, Task<object?>>> |
| 6 | { |
| 7 | public async Task<object?> Emit(IPlugin plugin, Event? @event = null, CancellationToken cancellationToken = default) |
| 8 | { |
| 9 | object? result = null; |
| 10 | @event ??= []; |
| 11 | |
| 12 | foreach (var fn in this) |
| 13 | { |
| 14 | var res = await fn(plugin, @event, cancellationToken); |
| 15 | result ??= res; |
| 16 | } |
| 17 | |
| 18 | return result; |
| 19 | } |
| 20 | } |