Inheritance: System.Collections.Specialized.NotifyCollectionChangedEventArgs
Beispiel #1
0
        internal void Replace(SessionAnnouncement oldAnnouncement, SessionAnnouncement newAnnouncement)
        {
            Session key   = oldAnnouncement.Session;
            int     index = _sessions.IndexOfKey(key);

            _sessions[key] = newAnnouncement;
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(IndexerName));
            }
            if (CollectionChanged != null)
            {
                var eventArgs = new SessionChangedEventArgs(SessionChange.Update, newAnnouncement, oldAnnouncement, index);
                CollectionChanged(this, eventArgs);
            }
        }
Beispiel #2
0
        internal void Remove(SessionAnnouncement announcement)
        {
            int index = _sessions.IndexOfKey(announcement.Session);

            _sessions.RemoveAt(index);

            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(CountString));
                PropertyChanged(this, new PropertyChangedEventArgs(IndexerName));
            }
            if (CollectionChanged != null)
            {
                var eventArgs = new SessionChangedEventArgs(SessionChange.Delete, announcement, index);
                CollectionChanged(this, eventArgs);
            }
        }
Beispiel #3
0
        internal void Add(SessionAnnouncement announcement)
        {
            Session session = announcement.Session;

            _sessions.Add(session, announcement);
            int index = _sessions.IndexOfKey(announcement.Session);

            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(CountString));
                PropertyChanged(this, new PropertyChangedEventArgs(IndexerName));
            }
            if (CollectionChanged != null)
            {
                var eventArgs = new SessionChangedEventArgs(SessionChange.New, announcement, index);
                CollectionChanged(this, eventArgs);
            }
        }