internal NotificationCallback(CMsgClientUserNotifications msg) { var list = msg.notifications .Select(n => new Notification(n)) .ToList(); this.Notifications = new ReadOnlyCollection<Notification>(list); }
internal NotificationsCallback(JobID jobID, CMsgClientUserNotifications msg) { JobID = jobID; if (msg == null || msg.notifications == null) { return; } Notifications = new List<Notification>(msg.notifications.Count); foreach (var notification in msg.notifications) { Notifications.Add(new Notification((Notification.ENotificationType) notification.user_notification_type)); } }
internal NotificationsCallback(JobID jobID, CMsgClientUserNotifications msg) { if ((jobID == null) || (msg == null)) { throw new ArgumentNullException(nameof(jobID) + " || " + nameof(msg)); } JobID = jobID; if (msg.notifications.Count == 0) { return; } Notifications = new HashSet<ENotification>(msg.notifications.Select(notification => (ENotification) notification.user_notification_type)); }
internal NotificationCallback(CMsgClientUserNotifications.Notification body) { NotificationType = (ENotificationType) body.user_notification_type; }
internal Notification(CMsgClientUserNotifications.Notification notification) { Count = notification.count; UserNotificationType = (UserNotificationType)notification.user_notification_type; }