Ejemplo n.º 1
0
        private static MetaAccessor MakeMemberAccessor(Type accessorType, MemberInfo member, MetaAccessor storageAccessor)
        {
            var field = member as FieldInfo;

            if (field != null)
            {
                return(FieldAccessor.Create(accessorType, field));
            }

            var property = (PropertyInfo)member;

            return(PropertyAccessor.Create(accessorType, property, storageAccessor));
        }
Ejemplo n.º 2
0
        private static MetaAccessor MakeMemberAccessor(Type accessorType, MemberInfo mi)
        {
            FieldInfo    fi  = mi as FieldInfo;
            MetaAccessor acc = null;

            if (fi != null)
            {
                acc = FieldAccessor.Create(accessorType, fi);
            }
            else
            {
                PropertyInfo pi = (PropertyInfo)mi;
                acc = PropertyAccessor.Create(accessorType, pi, null);
            }
            return(acc);
        }