Beispiel #1
0
        public bool Equals(IResultSet x, IResultSet y)
        {
            IResultSetElement[] xElements = x.Elements.ToArray();
            IResultSetElement[] yElements = y.Elements.ToArray();

            if (xElements.Length != yElements.Length)
            {
                return(false);
            }

            int count = xElements.Length;

            for (int i = 0; i < count; i++)
            {
                IResultSetElement xElement = xElements[i];
                IResultSetElement yElement = yElements[i];

                if (!xElement.Equals(yElement))
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
        public bool Equals(IResultSet x, IResultSet y)
        {
            List <IResultSetElement> xElements = x.Elements.ToList();
            List <IResultSetElement> yElements = y.Elements.ToList();

            if (xElements.Count != yElements.Count)
            {
                return(false);
            }

            for (int i = 0; i < xElements.Count; i++)
            {
                IResultSetElement xElement = xElements[i];

                bool equals = false;

                int j = 0;
                for (; j < yElements.Count; j++)
                {
                    IResultSetElement yElement = yElements[j];

                    if (xElement.Equals(yElement))
                    {
                        equals = true;
                        break;
                    }
                }

                if (!equals)
                {
                    return(false);
                }
                else
                {
                    yElements.RemoveAt(j);
                }
            }

            return(true);
        }