public Task SendInitiativeStatusChangedAsync(InitiativeStatusChangedEventArgs args) { var tasks = new List <Task>(); var cancellationToken = new System.Threading.CancellationToken(); foreach (var h in _messageReceiver.InitiativeStatusChangedHandlers) { tasks.Add(h(args, cancellationToken)); } return(Task.WhenAll(tasks)); }
public Task SendInitiativeStatusChangedAsync(InitiativeStatusChangedEventArgs args) { if (args == null) { throw new ArgumentNullException("args"); } if (args.Initiative == null) { throw new ArgumentException("Initiative cannot be null"); } var userProperties = new Dictionary <string, object>(); SetInitiative(args.Initiative, userProperties); return(_messageSender.SendMessageAsync(STATUS_CHANGED, userProperties)); }