private void onMessageHandler(object sender, NotificationArguments e) { if (e.Connections.Contains(this.ConnectionId)) { this.Notification = e.Notification; this.notificationReceived = true; } }
public void Notify(TypedNotification notification, params string[] usersIds) { List <Guid> destinationsIds = new List <Guid>(); foreach (var userId in usersIds) { if (Connections.TryGetValue(userId, out List <Guid> connections)) { destinationsIds.AddRange(connections); } } if (destinationsIds.Count() > 0) { this._event.Invoke(this, new NotificationArguments(notification, destinationsIds)); _resetEvent.Set(); } }
public NotificationArguments(TypedNotification notification, IEnumerable <Guid> destinations) { this.Notification = notification; this.Connections = destinations.Distinct(); }