Exemplo n.º 1
0
            public static VisitErrorCode TryExecute(object target, PropertyPath propertyName, int index, IPropertyVisitor visitor,
                                                    ref ChangeTracker changeTracker)
            {
                var action = new VisitAtPathCallback(target, propertyName, index, visitor, ref changeTracker);

                PropertyBagResolver.Resolve(target.GetType()).Cast(ref action);
                changeTracker = action.m_ChangeTracker;
                return(action.errorCode);
            }
Exemplo n.º 2
0
        static VisitErrorCode TryVisitAtPathImpl <TContainer>(ref TContainer container, PropertyPath propertyPath,
                                                              int propertyPathIndex, IPropertyVisitor visitor, ref ChangeTracker changeTracker)
        {
            var action = new VisitAtPathGetter <TContainer>(propertyPath, propertyPathIndex, visitor);

            if (PropertyBagResolver.Resolve <TContainer>()
                .FindProperty(propertyPath[propertyPathIndex].Name, ref container, ref changeTracker, ref action))
            {
                return(action.ErrorCode);
            }

            if (typeof(TContainer) != container.GetType())
            {
                return(VisitAtPathCallback.TryExecute(container, propertyPath, propertyPathIndex, visitor, ref changeTracker));
            }

            return(VisitErrorCode.InvalidPath);
        }