Ejemplo n.º 1
0
        internal override CodeExpression Clone(CodeExpression expression)
        {
            CodeCastExpression expression2 = (CodeCastExpression)expression;

            return(new CodeCastExpression {
                TargetType = TypeReferenceExpression.CloneType(expression2.TargetType), Expression = RuleExpressionWalker.Clone(expression2.Expression)
            });
        }
        internal override CodeExpression Clone(CodeExpression expression)
        {
            CodeObjectCreateExpression expression2 = (CodeObjectCreateExpression)expression;
            CodeObjectCreateExpression expression3 = new CodeObjectCreateExpression {
                CreateType = TypeReferenceExpression.CloneType(expression2.CreateType)
            };

            foreach (CodeExpression expression4 in expression2.Parameters)
            {
                expression3.Parameters.Add(RuleExpressionWalker.Clone(expression4));
            }
            return(expression3);
        }
Ejemplo n.º 3
0
        private static CodeMethodReferenceExpression CloneMethodReference(CodeMethodReferenceExpression oldReference)
        {
            CodeMethodReferenceExpression result = new CodeMethodReferenceExpression {
                MethodName   = oldReference.MethodName,
                TargetObject = RuleExpressionWalker.Clone(oldReference.TargetObject)
            };

            foreach (CodeTypeReference reference in oldReference.TypeArguments)
            {
                result.TypeArguments.Add(TypeReferenceExpression.CloneType(reference));
            }
            ConditionHelper.CloneUserData(oldReference, result);
            return(result);
        }
Ejemplo n.º 4
0
        internal override CodeExpression Clone(CodeExpression expression)
        {
            CodeArrayCreateExpression expression2 = (CodeArrayCreateExpression)expression;
            CodeArrayCreateExpression expression3 = new CodeArrayCreateExpression {
                CreateType = TypeReferenceExpression.CloneType(expression2.CreateType),
                Size       = expression2.Size
            };

            if (expression2.SizeExpression != null)
            {
                expression3.SizeExpression = RuleExpressionWalker.Clone(expression2.SizeExpression);
            }
            foreach (CodeExpression expression4 in expression2.Initializers)
            {
                expression3.Initializers.Add(RuleExpressionWalker.Clone(expression4));
            }
            return(expression3);
        }