private NotifierState GetNotifierState() { var orderedList = NotifierStateList.Enum().Where(x => x.Notifier.Guid == _notifier.Guid).Enum().OrderByDescending(x => x.Level); if (orderedList.IsNullOrEmpty()) { throw new Exception("Reporter progress, il n'existe pas de notifier state"); } return(NotifierStateList.Where(x => x.Notifier.Guid == _notifier.Guid).OrderByDescending(x => x.Level).First()); }
public void Dispose() { lock (_notifierStateListLocker) { var orderedList = NotifierStateList.Enum().Where(x => x.Notifier.Guid == _notifier.Guid).Enum().OrderByDescending(x => x.Level); if (orderedList.IsNullOrEmpty()) { throw new Exception("Reporter dispose, ne peut pas être disposé"); } var lastLevel = orderedList.First(); NotifierStateList.Remove(lastLevel); } }