// ReSharper disable once UnusedParameter.Local
        private void OnChildNodeChanged(object _, TrackerChangedEventArgs <DirtyTrackerNode> e)
        {
            if (this.Builder == null)
            {
                return;
            }

            if (e.Previous?.Contains(this) == true)
            {
                return;
            }

            var propertyGraphChangedEventArgs = e as PropertyGraphChangedEventArgs <DirtyTrackerNode>;

            if (propertyGraphChangedEventArgs != null)
            {
                this.OnChildNodeChanged(propertyGraphChangedEventArgs);
                return;
            }

            var itemGraphChangedEventArgs = e as ItemGraphChangedEventArgs <DirtyTrackerNode>;

            if (itemGraphChangedEventArgs != null)
            {
                this.OnChildNodeChanged(itemGraphChangedEventArgs);
                return;
            }

            throw Throw.ExpectedParameterOfTypes <PropertyGraphChangedEventArgs <DirtyTrackerNode>, ItemGraphChangedEventArgs <DirtyTrackerNode> >("OnChildNodeChanged failed.");
        }
 protected TrackerChangedEventArgs(
     T node,
     TrackerChangedEventArgs <T> previous = null)
 {
     this.Node     = node;
     this.Previous = previous;
 }
Example #3
0
            private void OnDirtyTrackerNodeChanged(object sender, TrackerChangedEventArgs <DirtyTrackerNode> e)
            {
                var root = e.Root;

                lock (this.gate)
                {
                    // below is not perfect but catches simple cases of when target changes
                    if (this.processingNode == null &&
                        !ReferenceEquals(root.Node.X, root.EventArgs.Source) &&
                        ReferenceEquals(root.Node.Y, root.EventArgs.Source))
                    {
                        if (this.RootNode.AllChildNodes()
                            .All(x => !ReferenceEquals(x.X, root.EventArgs.Source)))
                        {
                            var message = "Target cannot be modified when a synchronizer is applied to it\r\n"
                                          + "The change would just trigger a dirty notification and the value would be updated with the value from source.";
                            throw new InvalidOperationException(message);
                        }
                    }

                    if (!root.Node.IsDirty)
                    {
                        return;
                    }

                    this.AddToSyncQueue(root.Node);
                }
            }
Example #4
0
        private void OnChildNodeChanged(object sender, TrackerChangedEventArgs <ChangeTrackerNode> e)
        {
            if (e.Previous?.Contains(this) == true)
            {
                return;
            }

            this.Changed?.Invoke(this, e);
        }
Example #5
0
 private void OnNodeChanged(object sender, TrackerChangedEventArgs <T> e)
 {
     this.Changed?.Invoke(this, e.With(this.parent, this.PropertyInfo));
 }
Example #6
0
 internal PropertyGraphChangedEventArgs(T node, PropertyInfo property, TrackerChangedEventArgs <T> previous = null)
     : base(node, previous)
 {
     this.Property = property;
 }