Пример #1
0
        public static bool operator ==(PropertyRoute x, PropertyRoute y)
        {
            if (object.ReferenceEquals(x, y))
            {
                return(true);
            }

            if (object.ReferenceEquals(x, null) || object.ReferenceEquals(y, null))
            {
                return(false);
            }

            return((PropertyRouteSegment.Equals(x.m_current, y.m_current)) &&
                   (x.m_parent == y.m_parent));
        }
Пример #2
0
        internal static PropertyRoute Combine(PropertyRouteSegment segment, PropertyRoute ancestors)
        {
            if (ancestors == null)
            {
                return(new PropertyRoute(segment));
            }

            if (ancestors.Current.Type != PropertyRouteSegmentType.Other)
            {
                return(new PropertyRoute(segment, ancestors));
            }

            var path = PropertyRouteParser.Parse(new PropertyRoute(segment, new PropertyRoute(ancestors.Current)));

            Debug.Assert(!string.IsNullOrEmpty(path));

            return(new PropertyRoute(new PropertyRouteSegment(PropertyRouteSegmentType.Other, path), ancestors.Parent));
        }
Пример #3
0
 private PropertyRoute(PropertyRouteSegment segment, PropertyRoute parent)
 {
     m_current = segment;
     m_parent  = parent;
 }
Пример #4
0
 internal PropertyRoute(PropertyRouteSegment segment)
     : this(segment, null)
 {
 }
Пример #5
0
 internal static PropertyRoute Combine(PropertyRoute descendants, PropertyRouteSegment segment)
 {
     return(PropertyRoute.Combine(descendants, new PropertyRoute(segment)));
 }
 internal static PropertyRoute ToPropertyRoute(PropertyRouteSegment segment)
 {
     return(new PropertyRoute(segment));
 }
 internal void PushDescendant(PropertyRouteSegment segment)
 {
     m_segments.Add(segment);
 }
 internal void PushAncestor(PropertyRouteSegment segment)
 {
     m_segments.Insert(0, segment);
 }