Ru.GameSchool.DataLayer.Repository.Course.FixupAnnouncements C# (CSharp) Method

FixupAnnouncements() private method

private FixupAnnouncements ( object sender, NotifyCollectionChangedEventArgs e ) : void
sender object
e System.Collections.Specialized.NotifyCollectionChangedEventArgs
return void
        private void FixupAnnouncements(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (Announcement item in e.NewItems)
                {
                    item.Course = this;
                }
            }
    
            if (e.OldItems != null)
            {
                foreach (Announcement item in e.OldItems)
                {
                    if (ReferenceEquals(item.Course, this))
                    {
                        item.Course = null;
                    }
                }
            }
        }