Estro.TinyGest.Entities.Customer.FixupInvoices C# (CSharp) Method

FixupInvoices() private method

private FixupInvoices ( object sender, NotifyCollectionChangedEventArgs e ) : void
sender object
e System.Collections.Specialized.NotifyCollectionChangedEventArgs
return void
        private void FixupInvoices(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (Invoice item in e.NewItems)
                {
                    item.CustomerRef = this;
                }
            }

            if (e.OldItems != null)
            {
                foreach (Invoice item in e.OldItems)
                {
                    if (ReferenceEquals(item.CustomerRef, this))
                    {
                        item.CustomerRef = null;
                    }
                }
            }
        }