public NotificationHook(ICollection <TDepLeft> lefts, ICollection <TDepRight> rights, ISynchronizationContext context, SynchronizationMultipleDependency <TLeft, TRight, TDepLeft, TDepRight> parent) { Lefts = lefts; Rights = rights; Context = context; Parent = parent; }
public void SynchronizeMany <TDepLeft, TDepRight>(SynchronizationRule <TDepLeft, TDepRight> rule, Expression <Func <TLeft, ICollectionExpression <TDepLeft> > > leftSelector, Expression <Func <TRight, ICollectionExpression <TDepRight> > > rightSelector) where TDepLeft : class where TDepRight : class { if (rule == null) { throw new ArgumentNullException("rule"); } if (leftSelector == null) { throw new ArgumentNullException("leftSelector"); } if (rightSelector == null) { throw new ArgumentNullException("rightSelector"); } var dependency = new SynchronizationMultipleDependency <TLeft, TRight, TDepLeft, TDepRight>(this, rule, leftSelector, rightSelector); LeftToRight.Dependencies.Add(dependency.CreateLeftToRightDependency()); RightToLeft.Dependencies.Add(dependency.CreateRightToLeftDependency()); }
public BidirectionalHook(ICollection <TDepLeft> lefts, ICollection <TDepRight> rights, ISynchronizationContext context, SynchronizationMultipleDependency <TLeft, TRight, TDepLeft, TDepRight> parent) : base(lefts, rights, context, parent) { var leftNotifier = lefts as INotifyCollectionChanged; var rightNotifier = rights as INotifyCollectionChanged; if (leftNotifier != null) { leftNotifier.CollectionChanged += LeftsChanged; } if (rightNotifier != null) { rightNotifier.CollectionChanged += RightsChanged; } }
public RightToLeftHook(ICollection <TDepLeft> lefts, ICollection <TDepRight> rights, ISynchronizationContext context, SynchronizationMultipleDependency <TLeft, TRight, TDepLeft, TDepRight> parent) : base(lefts, rights, context, parent) { var notifier = rights as INotifyCollectionChanged; if (notifier != null) { notifier.CollectionChanged += RightsChanged; } }
public RTLDependency(SynchronizationMultipleDependency <TLeft, TRight, TDepLeft, TDepRight> parent) { this.parent = parent; }