The Labs \ Source Viewer \ SSCLI \ System.Xml.XPath \ XPathItem

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XPathItem.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. // <owner current="true" primary="true">akimball</owner>
  15. //------------------------------------------------------------------------------
  16. using System;
  17. using System.Collections;
  18. using System.Xml.Schema;
  19. namespace System.Xml.XPath
  20. {
  21.     /// <summary>
  22.     /// Base class for XPathNavigator and XmlAtomicValue.
  23.     /// </summary>
  24.     public abstract class XPathItem
  25.     {
  26.         /// <summary>
  27.         /// True if this item is a node, and not an atomic value.
  28.         /// </summary>
  29.         public abstract bool IsNode {
  30.             get;
  31.         }
  32.        
  33.         /// <summary>
  34.         /// Returns Xsd type of atomic value, or of node's content.
  35.         /// </summary>
  36.         public abstract XmlSchemaType XmlType {
  37.             get;
  38.         }
  39.        
  40.         /// <summary>
  41.         /// Typed and untyped value accessors.
  42.         /// </summary>
  43.         public abstract string Value {
  44.             get;
  45.         }
  46.         public abstract object TypedValue {
  47.             get;
  48.         }
  49.         public abstract Type ValueType {
  50.             get;
  51.         }
  52.         public abstract bool ValueAsBoolean {
  53.             get;
  54.         }
  55.         public abstract DateTime ValueAsDateTime {
  56.             get;
  57.         }
  58.         public abstract double ValueAsDouble {
  59.             get;
  60.         }
  61.         public abstract int ValueAsInt {
  62.             get;
  63.         }
  64.         public abstract long ValueAsLong {
  65.             get;
  66.         }
  67.         public virtual object ValueAs(Type returnType)
  68.         {
  69.             return ValueAs(returnType, null);
  70.         }
  71.         public abstract object ValueAs(Type returnType, IXmlNamespaceResolver nsResolver);
  72.     }
  73. }

Developer Fusion