コード例 #1
0
    public SerializableInvocationExpression(InvocationExpression expression, SerializableExpressionConverter converter)
      : base(expression)
    {
      Contract.Requires(expression != null);
      Contract.Requires(converter != null);

      Arguments = converter.TryConvert(expression.Arguments);
      Expr = converter.TryConvert(expression.Expression);
    }
コード例 #2
0
        public SerializableListInitExpression(ListInitExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Initializers  = expression.Initializers.Select(i => Tuple.Create(SerializableExpressionConverter.Convert(i.AddMethod), converter.TryConvert(i.Arguments))).ToList();
            NewExpression = converter.TryConvert <SerializableNewExpression>(expression.NewExpression);
        }
コード例 #3
0
        public SerializableUnaryExpression(UnaryExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Method  = SerializableExpressionConverter.Convert(expression.Method);
            Operand = converter.TryConvert(expression.Operand);
        }
コード例 #4
0
        public SerializableTypeBinaryExpression(TypeBinaryExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Expr        = converter.TryConvert(expression.Expression);
            TypeOperand = expression.TypeOperand;
        }
コード例 #5
0
        public SerializableConditionalExpression(ConditionalExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            IfFalse = converter.TryConvert(expression.IfFalse);
            IfTrue  = converter.TryConvert(expression.IfTrue);
            Test    = converter.TryConvert(expression.Test);
        }
コード例 #6
0
        public SerializableIndexExpression(IndexExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Arguments = converter.TryConvert(expression.Arguments);
            Indexer   = expression.Indexer;
            Object    = converter.TryConvert(expression.Object);
        }
コード例 #7
0
        public SerializableBlockExpression(BlockExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Expressions = converter.TryConvert(expression.Expressions);
            Result      = converter.TryConvert(expression.Result);
            Variables   = converter.TryConvert <SerializableParameterExpression>(expression.Variables);
        }
コード例 #8
0
        public SerializableNewExpression(NewExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Arguments   = converter.TryConvert(expression.Arguments);
            Constructor = expression.Constructor;
            Members     = converter.TryConvert(expression.Members);
        }
コード例 #9
0
        public SerializableMethodCallExpression(MethodCallExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Arguments = converter.TryConvert(expression.Arguments);
            Method    = SerializableExpressionConverter.Convert(expression.Method);
            Object    = converter.TryConvert(expression.Object);
        }
コード例 #10
0
        public SerializableLabelExpression(LabelExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            DefaultValue = converter.TryConvert(expression.DefaultValue);
            TargetName   = expression.Target.Name;
            TargetType   = expression.Target.Type;
        }
コード例 #11
0
        public SerializableLambdaExpression(LambdaExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Body       = converter.TryConvert(expression.Body);
            Name       = expression.Name;
            Parameters = converter.TryConvert <SerializableParameterExpression>(expression.Parameters);
            TailCall   = expression.TailCall;
        }
コード例 #12
0
        public SerializableGotoExpression(GotoExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Kind       = expression.Kind;
            TargetName = expression.Target.Name;
            TargetType = expression.Target.Type;
            Value      = converter.TryConvert(expression.Value);
        }
コード例 #13
0
        public SerializableSwitchExpression(SwitchExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Cases       = expression.Cases.Select(c => Tuple.Create(converter.TryConvert(c.Body), converter.TryConvert(c.TestValues))).ToList();
            Comparison  = SerializableExpressionConverter.Convert(expression.Comparison);
            DefaultBody = converter.TryConvert(expression.DefaultBody);
            SwitchValue = converter.TryConvert(expression.SwitchValue);
        }
コード例 #14
0
        public SerializableBinaryExpression(BinaryExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Conversion     = converter.TryConvert <SerializableLambdaExpression>(expression.Conversion);
            IsLiftedToNull = expression.IsLiftedToNull;
            Left           = converter.TryConvert(expression.Left);
            Method         = SerializableExpressionConverter.Convert(expression.Method);
            Right          = converter.TryConvert(expression.Right);
        }
コード例 #15
0
        public SerializableLoopExpression(LoopExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Body              = converter.TryConvert(expression.Body);
            BreakLabelType    = expression.BreakLabel.Type;
            BreakLabelName    = expression.BreakLabel.Name;
            ContinueLabelType = expression.ContinueLabel.Type;
            ContinueLabelName = expression.ContinueLabel.Name;
        }
コード例 #16
0
 public SerializableTryExpression(TryExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Body     = converter.Convert(expression.Body);
     Fault    = converter.Convert(expression.Fault);
     Finally  = converter.Convert(expression.Finally);
     Handlers = expression.Handlers
                .Select(h => Tuple.Create(
                            converter.Convert(h.Body),
                            converter.Convert(h.Filter),
                            h.Test,
                            converter.Convert <SerializableParameterExpression>(h.Variable)))
                .ToList();
 }
コード例 #17
0
 public SerializableUnaryExpression(UnaryExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Method  = SerializableExpressionConverter.Convert(expression.Method);
     Operand = converter.Convert(expression.Operand);
 }
コード例 #18
0
 internal override Expression ConvertBack()
 => Expression.MakeMemberAccess(
     Expr.TryConvertBack(),
     SerializableExpressionConverter.Convert(Member));
コード例 #19
0
 public SerializableTypeBinaryExpression(TypeBinaryExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Expr        = converter.Convert(expression.Expression);
     TypeOperand = expression.TypeOperand;
 }
コード例 #20
0
 public SerializableMemberExpression(MemberExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Expr   = converter.Convert(expression.Expression);
     Member = converter.Convert(expression.Member);
 }
コード例 #21
0
 internal override Expression ConvertBack()
 => Expression.Call(
     Object.TryConvertBack(),
     SerializableExpressionConverter.Convert(Method),
     Arguments.TryConvert());
コード例 #22
0
 internal override Expression ConvertBack()
 => Expression.MakeUnary(
     NodeType,
     Operand.TryConvertBack(),
     Type,
     SerializableExpressionConverter.Convert(Method));
コード例 #23
0
 public SerializableMemberInitExpression(MemberInitExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Bindings      = expression.Bindings.Select(converter.Convert).ToList();
     NewExpression = converter.Convert <SerializableNewExpression>(expression.NewExpression);
 }
コード例 #24
0
 internal override Expression ConvertBack()
 => Expression.ListInit(
     NewExpression.TryConvertBack <NewExpression>(),
     Initializers.Select(i => Expression.ElementInit(SerializableExpressionConverter.Convert(i.Item1), i.Item2.TryConvert())));
コード例 #25
0
 public SerializableInvocationExpression(InvocationExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Arguments = converter.Convert(expression.Arguments);
     Expr      = converter.Convert(expression.Expression);
 }
コード例 #26
0
 internal override Expression Convert() => Expression.Switch(
     Type,
     SwitchValue.TryConvert(),
     DefaultBody.TryConvert(),
     SerializableExpressionConverter.Convert(Comparison),
     Cases.Select(c => Expression.SwitchCase(c.Item1.TryConvert(), c.Item2.TryConvert())));
コード例 #27
0
        public SerializableRuntimeVariablesExpression(RuntimeVariablesExpression expression, SerializableExpressionConverter converter)
            : base(expression)
        {
            Contract.Requires(expression != null);
            Contract.Requires(converter != null);

            Variables = converter.TryConvert <SerializableParameterExpression>(expression.Variables);
        }
コード例 #28
0
 public SerializableRuntimeVariablesExpression(RuntimeVariablesExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Variables = converter.Convert <SerializableParameterExpression>(expression.Variables);
 }
コード例 #29
0
 public SerializableNewArrayExpression(NewArrayExpression expression, SerializableExpressionConverter converter)
     : base(expression)
 {
     Expressions = converter.Convert(expression.Expressions);
 }