Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Xml / System / Xml / XPath / Internal / ParentQuery.cs
blobb755fa5352dc782c6aab15008187656d5986480c
1 //------------------------------------------------------------------------------
2 // <copyright file="ParentQuery.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace MS.Internal.Xml.XPath {
9 using System;
10 using System.Xml;
11 using System.Xml.XPath;
12 using System.Diagnostics;
13 using System.Globalization;
14 using System.Collections.Generic;
16 internal sealed class ParentQuery : CacheAxisQuery {
18 public ParentQuery(Query qyInput, string Name, string Prefix, XPathNodeType Type) : base(qyInput, Name, Prefix, Type) {}
19 private ParentQuery(ParentQuery other) : base(other) { }
21 public override object Evaluate(XPathNodeIterator context) {
22 base.Evaluate(context);
24 //
25 XPathNavigator input;
26 while ((input = qyInput.Advance()) != null) {
27 input = input.Clone();
29 if (input.MoveToParent()) {
30 if (matches(input)) {
31 Insert(outputBuffer, input);
35 return this;
38 public override XPathNodeIterator Clone() { return new ParentQuery(this); }