Ejemplo n.º 1
0
        public Type ToType(ExpressionContext context)
        {
            var type = context.ResolveType(this);
            if (type == null)
            {
                if (string.IsNullOrWhiteSpace(Name))
                    return null;
                throw new SerializationException(string.Format("Failed to serialize '{0}' to a type object.", Name));
            }

            if (GenericArguments != null) type = type.MakeGenericType(GenericArguments.Select(t => t.ToType(context)).ToArray());

            return type;
        }
 internal override MemberBinding ToMemberBinding(ExpressionContext context)
 {
     return Expression.MemberBind(Member.ToMemberInfo(context), Bindings.GetMemberBindings(context));
 }
Ejemplo n.º 3
0
 internal ElementInit ToElementInit(ExpressionContext context)
 {
     return Expression.ElementInit(this.AddMethod.ToMemberInfo(context), this.Arguments.GetExpressions(context));
 }
Ejemplo n.º 4
0
 internal abstract MemberBinding ToMemberBinding(ExpressionContext context);
 internal override MemberBinding ToMemberBinding(ExpressionContext context)
 {
     return Expression.ListBind(Member.ToMemberInfo(context), Initializers.GetElementInits(context));
 }
Ejemplo n.º 6
0
 internal override MemberBinding ToMemberBinding(ExpressionContext context)
 {
     return System.Linq.Expressions.Expression.Bind(this.Member.ToMemberInfo(context), this.Expression.ToExpression(context));
 }