public static SerializableDictionary<string, GenericNotificationItem> GetNotificationItems(
   Predicate<GenericNotificationItem> getter)
 {
   lock (GenericNotificationManager.syncNotificationsReadWrite)
   {
     SerializableDictionary<string, GenericNotificationItem> savedNotifications = GenericNotificationManager.GetSavedNotifications();
     SerializableDictionary<string, GenericNotificationItem> serializableDictionary = new SerializableDictionary<string, GenericNotificationItem>();
     Func<KeyValuePair<string, GenericNotificationItem>, bool> predicate = (Func<KeyValuePair<string, GenericNotificationItem>, bool>) (item => getter(item.Value));
     foreach (KeyValuePair<string, GenericNotificationItem> keyValuePair in savedNotifications.Where<KeyValuePair<string, GenericNotificationItem>>(predicate))
       serializableDictionary.Add(keyValuePair.Key, keyValuePair.Value);
     return serializableDictionary;
   }
 }
 public static SerializableDictionary<string, GenericNotificationItem> MarkNotification(
   IEnumerable<string> ids,
   System.Action<GenericNotificationItem> setter)
 {
   lock (GenericNotificationManager.syncNotificationsReadWrite)
   {
     SerializableDictionary<string, GenericNotificationItem> lstItem = new SerializableDictionary<string, GenericNotificationItem>();
     try
     {
       lstItem = GenericNotificationManager.GetSavedNotifications();
       foreach (string index in ids.Where<string>((Func<string, bool>) (id => id != null && lstItem.ContainsKey(id))))
         setter(lstItem[index]);
       GenericNotificationManager.SaveNotifications(lstItem);
     }
     catch (Exception ex)
     {
       Logger.Error("Failed to mark notification... Err : " + ex.ToString());
     }
     return lstItem;
   }
 }
 public static void AddNewNotification(
   GenericNotificationItem notificationItem,
   bool dontOverwrite = false)
 {
   lock (GenericNotificationManager.syncNotificationsReadWrite)
   {
     try
     {
       SerializableDictionary<string, GenericNotificationItem> savedNotifications = GenericNotificationManager.GetSavedNotifications();
       if (!dontOverwrite)
       {
         savedNotifications[notificationItem.Id] = notificationItem;
         GenericNotificationManager.SaveNotifications(savedNotifications);
       }
       else
       {
         if (savedNotifications.ContainsKey(notificationItem.Id))
           return;
         savedNotifications[notificationItem.Id] = notificationItem;
         GenericNotificationManager.SaveNotifications(savedNotifications);
       }
     }
     catch (Exception ex)
     {
       Logger.Error("Failed to add notification id : {0} titled : {1} and msg : {2}... Err : {3}", (object) notificationItem.Id, (object) notificationItem.Title, (object) notificationItem.Message, (object) ex.ToString());
     }
   }
 }