예제 #1
0
        public MapBindingTreeNodeContainer AddNewMapChild(IBindingPathLink<object> pathLink)
        {
            CreateChildren();

            MapBindingTreeNodeContainer childContainer =
                new MapBindingTreeNodeContainer();

            AddChild(pathLink, childContainer);

            return childContainer;
        }
예제 #2
0
        public void AddChild(
            IBindingPathLink<object> pathLink,
            IBindingTreeNodeContainer childContainer
        )
        {
            childContainer.ParentContainer = this;

            childContainer.SetPathLink(pathLink);

            CreateChildren();

            _children[pathLink] = childContainer;
            SetParentObjOnChildLink(childContainer);
        }
        public CompositePathSetter(IEnumerable <IBindingPathLink <object> > pathLinks)
        {
            IBindingPathLink <object> theSetterPathLink = pathLinks.Last();

            TheSetter = theSetterPathLink.CreateSetter();

            PropGetters =
                pathLinks
                .TakeWhile((pathLink) => (!Object.ReferenceEquals(pathLink, theSetterPathLink)))
                .Select((pathLink) => pathLink.CreateGetter())
                .ToList();

            IObjWithPropGetter <object> previousPropGetter = null;

            foreach (var propGetter in PropGetters)
            {
                IObjWithPropGetter <object> thePreviousPropGetter = previousPropGetter;
                if (previousPropGetter != null)
                {
                    thePreviousPropGetter.PropertyChangedEvent += () =>
                    {
                        propGetter.TheObj = thePreviousPropGetter.GetPropValue();
                    };
                }

                previousPropGetter = propGetter;
            }

            if (previousPropGetter != null)
            {
                IObjWithPropGetter <object> thePreviousPropGetter = previousPropGetter;
                // set the last property getter to the set the setter
                previousPropGetter.PropertyChangedEvent += () =>
                {
                    TheSetter.TheObj = thePreviousPropGetter.GetPropValue();
                };
            }
        }
예제 #4
0
 public void SetPathLink(IBindingPathLink<object> ownPathLink)
 {
     TheOwnPathLink = ownPathLink;
 }