/// <summary> /// Handles the event. /// </summary> /// <param name="message">The message.</param> private static void HandleEvent(Notification message) { if (message != null) { var notification = JsonConvert.DeserializeObject<NotificationEvent>(message.EventDetail); var value = JsonConvert.DeserializeObject<PersonChangeNotification>(notification.EventDescription); if (value != null && value.MachineName != null && !value.MachineName.Equals(DIContainer.Instance.Resolve<Workstation>().MachineName)) { UpdatePersonStatus(notification); } } }
/// <summary> /// Handles the event. /// </summary> /// <param name="message">The message.</param> private static void HandleEvent(Notification message) { if (message != null) { var workStation = DIContainer.Instance.Resolve<Workstation>(); if (message.EventTypeId.Equals(workStation.VoyageRolloverEventTypeId)) { Messenger.Instance.Notify(MessengerMessage.UpdateDetailsOnVoyageRollover); } } }
public void AddNotification(Notification connectToLastFmNotification) { if (Notifications == null) Notifications = new Collection<Notification>(); if (Notifications.All(c => c.Type == connectToLastFmNotification.Type && !c.Read)) { Notifications.Add(connectToLastFmNotification); DomainEvents.Raise(new NotificationAdded() { Artist = this, LastNotification = connectToLastFmNotification }); } }