Exemple #1
0
 public void Dispose()
 {
     this.dirtyTrackerNode.Value.Changed -= this.OnDirtyTrackerNodeChanged;
     this.dirtyTrackerNode.Dispose();
     this.borrowedQueue.Dispose();
     this.processingNode = null;
 }
Exemple #2
0
            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;
            }
Exemple #3
0
            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);
            }
Exemple #4
0
 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;
 }