示例#1
0
        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;
            }
        }
示例#2
0
 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;
         }
     }
 }
示例#3
0
        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);
        }
示例#4
0
        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;
            }
        }