private void BuildResultsList()
        {
            XPathNavigator navigator;
            int            numSorts = this.comparer.NumSorts;

            while ((navigator = this.qyInput.Advance()) != null)
            {
                SortKey item = new SortKey(numSorts, this.results.Count, navigator.Clone());
                for (int i = 0; i < numSorts; i++)
                {
                    item[i] = this.comparer.Expression(i).Evaluate(this.qyInput);
                }
                this.results.Add(item);
            }
            this.results.Sort(this.comparer);
        }
Exemplo n.º 2
0
        private void BuildResultsList()
        {
            int numSorts = _comparer.NumSorts;

            Debug.Assert(numSorts > 0, "Why was the sort query created?");

            XPathNavigator eNext;

            while ((eNext = _qyInput.Advance()) != null)
            {
                SortKey key = new SortKey(numSorts, /*originalPosition:*/ _results.Count, eNext.Clone());

                for (int j = 0; j < numSorts; j++)
                {
                    key[j] = _comparer.Expression(j).Evaluate(_qyInput);
                }

                _results.Add(key);
            }
            _results.Sort(_comparer);
        }