85653c0dcef360b802c598f01f261b53094dbdf9
[mono.git] / mcs / class / referencesource / System.Xml / System / Xml / XPath / XPathItem.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="XPathItem.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner> 
6 //------------------------------------------------------------------------------
7 using System;
8 using System.Collections;
9 using System.Xml.Schema;
10
11 namespace System.Xml.XPath {
12     /// <summary>
13     /// Base class for XPathNavigator and XmlAtomicValue.
14     /// </summary>
15     public abstract class XPathItem {
16         /// <summary>
17         /// True if this item is a node, and not an atomic value.
18         /// </summary>
19         public abstract bool IsNode { get; }
20
21         /// <summary>
22         /// Returns Xsd type of atomic value, or of node's content.
23         /// </summary>
24         public abstract XmlSchemaType XmlType { get; }
25
26         /// <summary>
27         /// Typed and untyped value accessors.
28         /// </summary>
29         public abstract string Value { get; }
30         public abstract object TypedValue { get; }
31         public abstract Type ValueType { get; }
32         public abstract bool ValueAsBoolean { get; }
33         public abstract DateTime ValueAsDateTime { get; }
34         public abstract double ValueAsDouble { get; }
35         public abstract int ValueAsInt { get; }
36         public abstract long ValueAsLong { get; }
37         public virtual object ValueAs(Type returnType) { return ValueAs(returnType, null); }
38         public abstract object ValueAs(Type returnType, IXmlNamespaceResolver nsResolver);
39     }
40 }
41