Ejemplo n.º 1
0
 public void Dispose()
 {
     this.dirtyTrackerNode.Value.Changed -= this.OnDirtyTrackerNodeChanged;
     this.dirtyTrackerNode.Dispose();
     this.borrowedQueue.Dispose();
     this.processingNode = null;
 }
Ejemplo n.º 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;
            }
Ejemplo n.º 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);
            }
Ejemplo n.º 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;
 }