Пример #1
0
        private static bool Compare(VariableInfo varInfo, TryExpression left, TryExpression right)
        {
            if ((left.Finally == null && right.Finally != null) ||
                (left.Finally != null && right.Finally == null))
            {
                return(false);
            }

            if (left.Handlers.Count != right.Handlers.Count)
            {
                return(false);
            }

            for (int i = 0; i < left.Handlers.Count; i++)
            {
                if (left.Handlers[i].Test != right.Handlers[i].Test)
                {
                    return(false);
                }

                if (varInfo.GetLeftVariable(left.Handlers[i].Variable) != varInfo.GetRightVariable(right.Handlers[i].Variable))
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #2
0
        private static bool Compare(VariableInfo varInfo, ParameterExpression left, ParameterExpression right)
        {
            if (varInfo.GetLeftVariable(left) != varInfo.GetRightVariable(right))
            {
                return(false);
            }

            return(true);
        }