QilLiteral.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / QIL / QilLiteral.cs / 1305376 / QilLiteral.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
//-----------------------------------------------------------------------------
using System; 
using System.Diagnostics; 

namespace System.Xml.Xsl.Qil { 

    /// 
    /// View over a Qil atomic value literal (of any type).
    ///  
    /// 
    /// Don't construct QIL nodes directly; instead, use the QilFactory. 
    ///  
    internal class QilLiteral : QilNode {
        private object value; 


        //-----------------------------------------------
        // Constructor 
        //-----------------------------------------------
 
        ///  
        /// Construct a new node
        ///  
        public QilLiteral(QilNodeType nodeType, object value) : base(nodeType) {
            Value = value;
        }
 

        //----------------------------------------------- 
        // QilLiteral methods 
        //-----------------------------------------------
 
        public object Value {
            get { return this.value; }
            set { this.value = value; }
        } 

        public static implicit operator string(QilLiteral literal) { 
            return (string) literal.value; 
        }
 
        public static implicit operator int(QilLiteral literal) {
            return (int) literal.value;
        }
 
        public static implicit operator long(QilLiteral literal) {
            return (long) literal.value; 
        } 

        public static implicit operator double(QilLiteral literal) { 
            return (double) literal.value;
        }

        public static implicit operator decimal(QilLiteral literal) { 
            return (decimal) literal.value;
        } 
 
        public static implicit operator XmlQueryType(QilLiteral literal) {
            return (XmlQueryType) literal.value; 
        }
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK