public override INotificationResult Notify(IList <INotificationResult> sources) { if (sources.Count == 0) { OnCleared(); return(CollectionChangedNotificationResult <T> .Create(this, true)); } else { var change = (ICollectionChangedNotificationResult)sources[0]; if (change.IsReset) { OnCleared(); } else { if (change.RemovedItems != null) { OnRemoveItems(change.RemovedItems.Cast <T>()); } if (change.AddedItems != null) { OnAddItems(change.AddedItems.Cast <T>()); } } return(CollectionChangedNotificationResult <T> .Transfer(change, this)); } }
public override INotificationResult Notify(IList <INotificationResult> sources) { var backParsed = (ICollectionChangedNotificationResult)sources[0]; if (HasEventSubscriber) { if (backParsed.IsReset) { OnCleared(); } else { if (backParsed.RemovedItems != null) { OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, backParsed.RemovedItems)); } if (backParsed.AddedItems != null) { OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, backParsed.AddedItems)); } if (backParsed.MovedItems != null) { OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, backParsed.MovedItems)); } } } return(CollectionChangedNotificationResult <T> .Transfer(backParsed, this)); }
public override INotificationResult Notify(IList <INotificationResult> sources) { return(CollectionChangedNotificationResult <TTarget> .Transfer((ICollectionChangedNotificationResult)sources[0], this)); }