Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / XPath / Internal / XPathSelfQuery.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="XPathSelfQuery.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>                                                                
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
7
8 namespace MS.Internal.Xml.XPath {
9     using System;
10     using System.Xml;
11     using System.Xml.XPath;
12     using System.Diagnostics;
13
14     internal sealed class XPathSelfQuery : BaseAxisQuery {
15         public XPathSelfQuery(Query qyInput, string Name, string Prefix, XPathNodeType Type) : base(qyInput, Name, Prefix, Type) {}
16         private XPathSelfQuery(XPathSelfQuery other) : base(other) { }
17                 
18         public override XPathNavigator Advance() {
19             while ((currentNode = qyInput.Advance()) != null) {
20                 if (matches(currentNode)) {
21                     position = 1;
22                     return currentNode;
23                 }
24             }
25             return null;
26         }
27                 
28         public override XPathNodeIterator Clone() { return new XPathSelfQuery(this); }
29     }
30 }