Exemplo n.º 1
0
        public static CodeExpression Clone(CodeExpression originalExpression)
        {
            if (originalExpression == null)
            {
                return(null);
            }
            CodeExpression result = GetExpression(originalExpression).Clone(originalExpression);

            ConditionHelper.CloneUserData(originalExpression, result);
            return(result);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public static CodeExpression Clone(CodeExpression originalExpression)
        {
            if (originalExpression == null)
            {
                return(null);
            }

            RuleExpressionInternal ruleExpr = GetExpression(originalExpression);
            CodeExpression         newExpr  = ruleExpr.Clone(originalExpression);

            ConditionHelper.CloneUserData(originalExpression, newExpr);

            return(newExpr);
        }
Exemplo n.º 4
0
        internal static CodeTypeReference CloneType(CodeTypeReference oldType)
        {
            if (oldType == null)
            {
                return(null);
            }
            CodeTypeReference result = new CodeTypeReference {
                ArrayElementType = CloneType(oldType.ArrayElementType),
                ArrayRank        = oldType.ArrayRank,
                BaseType         = oldType.BaseType
            };

            foreach (CodeTypeReference reference2 in oldType.TypeArguments)
            {
                result.TypeArguments.Add(CloneType(reference2));
            }
            ConditionHelper.CloneUserData(oldType, result);
            return(result);
        }