Esempio n. 1
0
        internal override bool Match(CodeExpression expression, CodeExpression comperand)
        {
            CodeCastExpression expression2 = (CodeCastExpression)expression;
            CodeCastExpression expression3 = (CodeCastExpression)comperand;

            return(TypeReferenceExpression.MatchType(expression2.TargetType, expression3.TargetType) && RuleExpressionWalker.Match(expression2.Expression, expression3.Expression));
        }
        internal override bool Match(CodeExpression expression, CodeExpression comperand)
        {
            CodeObjectCreateExpression expression2 = (CodeObjectCreateExpression)expression;
            CodeObjectCreateExpression expression3 = comperand as CodeObjectCreateExpression;

            if (expression3 == null)
            {
                return(false);
            }
            if (!TypeReferenceExpression.MatchType(expression2.CreateType, expression3.CreateType))
            {
                return(false);
            }
            if (expression2.Parameters.Count != expression3.Parameters.Count)
            {
                return(false);
            }
            for (int i = 0; i < expression2.Parameters.Count; i++)
            {
                if (!RuleExpressionWalker.Match(expression2.Parameters[i], expression3.Parameters[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 3
0
        internal override bool Match(CodeExpression expression, CodeExpression comperand)
        {
            CodeArrayCreateExpression expression2 = (CodeArrayCreateExpression)expression;
            CodeArrayCreateExpression expression3 = comperand as CodeArrayCreateExpression;

            if (((expression3 == null) || (expression2.Size != expression3.Size)) || !TypeReferenceExpression.MatchType(expression2.CreateType, expression3.CreateType))
            {
                return(false);
            }
            if (expression2.SizeExpression != null)
            {
                if (expression3.SizeExpression == null)
                {
                    return(false);
                }
                if (!RuleExpressionWalker.Match(expression2.SizeExpression, expression3.SizeExpression))
                {
                    return(false);
                }
            }
            else if (expression3.SizeExpression != null)
            {
                return(false);
            }
            if (expression2.Initializers.Count != expression3.Initializers.Count)
            {
                return(false);
            }
            for (int i = 0; i < expression2.Initializers.Count; i++)
            {
                if (!RuleExpressionWalker.Match(expression2.Initializers[i], expression3.Initializers[i]))
                {
                    return(false);
                }
            }
            return(true);
        }