Example #1
0
        public override bool IsRedundantVersion(PropertyAccessTreeNode other)
        {
            var otherAsPropertyNode = other as PropertyAccessNode;
            if (otherAsPropertyNode == null)
                return false;

            return other != this && otherAsPropertyNode.Property == this.Property;
        }
Example #2
0
 private void BuildChildren(PropertyAccessTreeNode root)
 {
     foreach (PropertyAccessTreeNode t in root.Children)
     {
         var childSubscriptionNode = new SubscriptionNode(_subscriberCallback, (PropertyAccessNode)t);
         _children.Add(childSubscriptionNode);
     }
 }
Example #3
0
        public override bool IsRedundantVersion(PropertyAccessTreeNode other)
        {
            ConstantNode otherAsConstantNode = other as ConstantNode;
            if (otherAsConstantNode == null)
                return false;

            return other != this && otherAsConstantNode.Value == this.Value;
        }
Example #4
0
                public RootSubscription(Action <TListener, object> subscriberCallback, PropertyAccessTreeNode parameterNode)
                {
                    _propertyAccessTreeNode = parameterNode;
                    _children           = new List <SubscriptionNode>();
                    _subscriberCallback = subscriberCallback;

                    BuildChildren(parameterNode);
                }
Example #5
0
        public override bool IsRedundantVersion(PropertyAccessTreeNode other)
        {
            var otherAsPropertyNode = other as PropertyAccessNode;

            if (otherAsPropertyNode == null)
            {
                return(false);
            }

            return(other != this && otherAsPropertyNode.Property == this.Property);
        }
Example #6
0
        public override bool IsRedundantVersion(PropertyAccessTreeNode other)
        {
            ConstantNode otherAsConstantNode = other as ConstantNode;

            if (otherAsConstantNode == null)
            {
                return(false);
            }

            return(other != this && otherAsConstantNode.Value == this.Value);
        }
Example #7
0
        public SubscriptionTree CreateSubscriptionTree(INotifyPropertyChanged parameter)
        {
            List <SubscriptionNode> subscribers = new List <SubscriptionNode>(this.Children.Count);

            for (int i = 0; i < this.Children.Count; i++)
            {
                PropertyAccessTreeNode child = this.Children[i];
                if (child.Children.Count > 0)
                {
                    var subscriptionNode = child.CreateSubscription(parameter);
                    subscribers.Add(subscriptionNode);
                }
            }
            var subscriptionTree = new SubscriptionTree(parameter, subscribers);

            return(subscriptionTree);
        }
Example #8
0
        private static void AddBranch(PropertyAccessTree tree, Stack <PropertyAccessTreeNode> currentNodeBranch)
        {
            if (currentNodeBranch.Count == 0)
            {
                return;
            }

            PropertyAccessTreeNode currentNode = currentNodeBranch.Pop();

            tree.Children.Add(currentNode);

            while (currentNodeBranch.Count != 0)
            {
                PropertyAccessTreeNode nextNode = currentNodeBranch.Pop();
                currentNode.Children.Add(nextNode);
                currentNode = nextNode;
            }
        }
        protected void SubscribeToChildren(SubscriptionNode subscriptionNode, INotifyPropertyChanged parameter)
        {
            for (int i = 0; i < this.Children.Count; i++)
            {
                PropertyAccessTreeNode child = this.Children[i];
                if (child.Children.Count == 0)
                {
                    continue;
                }

                SubscriptionNode childSubscriptionNode = child.CreateSubscription(parameter);

                if (subscriptionNode.Children == null)
                {
                    subscriptionNode.Children = new List <SubscriptionNode>();
                }

                subscriptionNode.Children.Add(childSubscriptionNode);
            }
        }
Example #10
0
        public override bool IsRedundantVersion(PropertyAccessTreeNode other)
        {
            var otherAsParameterNode = other as ParameterNode;

            return(otherAsParameterNode != null && otherAsParameterNode != this && this.Name == otherAsParameterNode.Name);
        }
 public abstract bool IsRedundantVersion(PropertyAccessTreeNode other);
 public abstract bool IsRedundantVersion(PropertyAccessTreeNode other);
Example #13
0
 public override bool IsRedundantVersion(PropertyAccessTreeNode other)
 {
     var otherAsParameterNode = other as ParameterNode;
     return otherAsParameterNode != null && otherAsParameterNode != this && this.Name == otherAsParameterNode.Name;
 }