Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / XPath / Internal / OperandQuery.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="OperandQuery.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     using System.Globalization;
14     using System.Collections;
15
16     internal sealed class OperandQuery : ValueQuery {
17         internal object val;
18
19         public OperandQuery(object val) {
20             this.val = val;
21         }
22
23         public override object Evaluate(XPathNodeIterator nodeIterator) {
24             return val;
25         }
26         public override XPathResultType StaticType { get { return GetXPathType(val); } }
27         public override XPathNodeIterator Clone() { return this; }
28
29         public override void PrintQuery(XmlWriter w) {
30             w.WriteStartElement(this.GetType().Name);
31             w.WriteAttributeString("value", Convert.ToString(val, CultureInfo.InvariantCulture));
32             w.WriteEndElement();
33         }
34     }
35 }