Ru.GameSchool.DataLayer.Repository.LevelMaterial.FixupComments C# (CSharp) Method

FixupComments() private method

private FixupComments ( object sender, NotifyCollectionChangedEventArgs e ) : void
sender object
e NotifyCollectionChangedEventArgs
return void
        private void FixupComments(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (Comment item in e.NewItems)
                {
                    item.LevelMaterial = this;
                }
            }
    
            if (e.OldItems != null)
            {
                foreach (Comment item in e.OldItems)
                {
                    if (ReferenceEquals(item.LevelMaterial, this))
                    {
                        item.LevelMaterial = null;
                    }
                }
            }
        }