public void Remove(BuildNotification notification) { BuildNotification entry = null; switch (notification.cat) { case BuildNotification.Category.Error: entry = FindDuplicate(notification, errors); if (entry != null) { errors.Remove(entry); } break; case BuildNotification.Category.Warning: entry = FindDuplicate(notification, warnings); if (entry != null) { warnings.Remove(entry); } break; case BuildNotification.Category.Notification: entry = FindDuplicate(notification, notifications); if (entry != null) { notifications.Remove(entry); } break; } }
private void RefreshList(List <BuildNotification> buildNotifications) { for (int i = 0; i < buildNotifications.Count; i++) { BuildNotification note = buildNotifications[i]; if (note.clearable) { buildNotifications.RemoveAt(i); --i; } } }
private BuildNotification FindDuplicate(BuildNotification notification, List <BuildNotification> list) { BuildNotification duplicate = null; for (int i = 0; i < list.Count; i++) { if (list[i].title.Equals(notification.title) && list[i].details.Equals(notification.details)) { duplicate = list[i]; break; } } return(duplicate); }
public void AddNotification(BuildNotification notification) { BuildNotification entry = null; switch (notification.cat) { case BuildNotification.Category.Error: entry = FindDuplicate(notification, errors); if (entry == null) { errors.Add(notification); } else if (entry.valid == null && notification.valid != null) { entry.valid = notification.valid; } break; case BuildNotification.Category.Warning: entry = FindDuplicate(notification, warnings); if (entry == null) { warnings.Add(notification); } else if (entry.valid == null && notification.valid != null) { entry.valid = notification.valid; } break; case BuildNotification.Category.Notification: entry = FindDuplicate(notification, notifications); if (entry == null) { notifications.Add(notification); } else if (entry.valid == null && notification.valid != null) { entry.valid = notification.valid; } break; } }