コード例 #1
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);
        }
コード例 #2
0
        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);
            }
        }