Example #1
0
        public bool Equals(IEnumerable <IToken> x, IEnumerable <IToken> y)
        {
            if (x == null)
            {
                throw new ArgumentNullException("x");
            }
            if (y == null)
            {
                throw new ArgumentNullException("y");
            }

            var tokensArrayX = x.ToArray();
            var tokensArrayY = y.ToArray();

            if (tokensArrayX.Length != tokensArrayY.Length)
            {
                return(false);
            }

            var tokenComparer = new TokenComparer();

            for (var index = 0; index < tokensArrayX.Length; index++)
            {
                if (!tokenComparer.Equals(tokensArrayX[index], tokensArrayY[index]))
                {
                    return(false);
                }
            }
            return(true);
        }
Example #2
0
        public bool Equals(BuiltInValueExpressionSegment x, BuiltInValueExpressionSegment y)
        {
            if (x == null)
            {
                throw new ArgumentNullException("x");
            }
            if (y == null)
            {
                throw new ArgumentNullException("y");
            }

            var tokenComparer = new TokenComparer();

            return(tokenComparer.Equals(x.Token, y.Token));
        }