Exemplo n.º 1
0
        void Remove(NotificationState notificationState, bool commit)
        {
            if (m_notificationDict.ContainsKey(notificationState.ObjectId))
            {
                var state = m_notificationDict[notificationState.ObjectId];
                m_orderedNotifications.Remove(state);
            }

            if (commit)
            {
                Save();
            }

            OnUpdated();
        }
Exemplo n.º 2
0
        private void Add(NotificationState notificationState, bool commit)
        {
            if (notificationState.ObjectId == 0)
            {
                throw new ArgumentException("Notification state must include an object ID");
            }

            RemoveExcess();

            if (!m_notificationDict.ContainsKey(notificationState.ObjectId))
            {
                m_notificationDict[notificationState.ObjectId] = notificationState;
                m_orderedNotifications.Add(notificationState);
            }

            if (commit)
            {
                Save();
            }

            OnUpdated();
        }
Exemplo n.º 3
0
 private void Add(NotificationState notificationState)
 {
     Add(notificationState, true);
 }
Exemplo n.º 4
0
 public void Remove(NotificationState notificationState)
 {
     Remove(notificationState, true);
 }