Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / XPath / Internal / AbsoluteQuery.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="AbsoluteQuery.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>                                                                
5 // <owner current="true" primary="true">[....]</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     using System.Globalization;
14
15     internal sealed class AbsoluteQuery : ContextQuery {
16         public  AbsoluteQuery()                    : base() {}
17         private AbsoluteQuery(AbsoluteQuery other) : base(other) {}
18
19         public override object Evaluate(XPathNodeIterator context) {
20             base.contextNode = context.Current.Clone();
21             base.contextNode.MoveToRoot();
22             count = 0;
23             return this; 
24         }
25
26         public override XPathNavigator MatchNode(XPathNavigator context) {
27             if (context != null && context.NodeType == XPathNodeType.Root) {
28                 return context;
29             }
30             return null;
31         }
32
33         public override XPathNodeIterator Clone() { return new AbsoluteQuery(this); }
34     }
35 }