File: System\Xml\XPath\Internal\Operand.cs
Web Access
Project: src\src\libraries\System.Private.Xml\src\System.Private.Xml.csproj (System.Private.Xml)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using System.Xml.XPath;
 
namespace MS.Internal.Xml.XPath
{
    internal sealed class Operand : AstNode
    {
        private readonly XPathResultType _type;
        private readonly object _val;
 
        public Operand(string val)
        {
            _type = XPathResultType.String;
            _val = val;
        }
 
        public Operand(double val)
        {
            _type = XPathResultType.Number;
            _val = val;
        }
 
        public override AstType Type { get { return AstType.ConstantOperand; } }
        public override XPathResultType ReturnType { get { return _type; } }
 
        public object OperandValue { get { return _val; } }
    }
}