1 //------------------------------------------------------------------------------
2 // <copyright file="IteratorFilter.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">[....]</owner>
6 //------------------------------------------------------------------------------
8 namespace MS.Internal.Xml.XPath {
11 using System.Xml.XPath;
12 using System.Diagnostics;
13 using System.Globalization;
15 internal class IteratorFilter : XPathNodeIterator {
16 private XPathNodeIterator innerIterator;
18 private int position = 0;
20 internal IteratorFilter(XPathNodeIterator innerIterator, string name) {
21 this.innerIterator = innerIterator;
25 private IteratorFilter(IteratorFilter it) {
26 this.innerIterator = it.innerIterator.Clone();
28 this.position = it.position;
31 public override XPathNodeIterator Clone() { return new IteratorFilter(this); }
32 public override XPathNavigator Current { get { return innerIterator.Current;} }
33 public override int CurrentPosition { get { return this.position; } }
35 public override bool MoveNext() {
36 while(innerIterator.MoveNext()) {
37 if(innerIterator.Current.LocalName == this.name) {