public void Dispose() { this.dirtyTrackerNode.Value.Changed -= this.OnDirtyTrackerNodeChanged; this.dirtyTrackerNode.Dispose(); this.borrowedQueue.Dispose(); this.processingNode = null; }
private void AddToSyncQueue(DirtyTrackerNode newNode) { var queue = this.borrowedQueue.Value; queue.Enqueue(newNode); if (this.processingNode != null) { return; } if (this.processingNode != null) { return; } while (queue.TryDequeue(out this.processingNode)) { if (this.processingNode.IsDirty) { Copy.PropertyValues(this.processingNode.X, this.processingNode.Y, this.Settings); } } this.processingNode = null; }
internal Synchronizer(INotifyPropertyChanged source, INotifyPropertyChanged target, PropertiesSettings settings) { this.Settings = settings; this.dirtyTrackerNode = DirtyTrackerNode.GetOrCreate(source, target, settings, true); this.dirtyTrackerNode.Value.Changed += this.OnDirtyTrackerNodeChanged; this.borrowedQueue = ConcurrentQueuePool <DirtyTrackerNode> .Borrow(); this.AddToSyncQueue(this.dirtyTrackerNode.Value); }
internal DirtyTracker(INotifyPropertyChanged x, INotifyPropertyChanged y, PropertiesSettings settings) { this.Settings = settings; this.node = DirtyTrackerNode.GetOrCreate(x, y, settings, isRoot: true); this.node.Value.PropertyChanged += this.OnNodeChanged; }