FunctionCommandText.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / FunctionCommandText.cs / 1 / FunctionCommandText.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner       [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 

using System; 
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics; 
using System.Xml;
using System.Data; 
using System.Data.Metadata.Edm; 

namespace System.Data.EntityModel.SchemaObjectModel 
{
    /// 
    /// Represents an CommandText element.
    ///  
    internal sealed class FunctionCommandText : SchemaElement
    { 
        private string _commandText; 

        ///  
        /// Constructs an FunctionCommandText
        /// 
        /// Reference to the schema element.
        public FunctionCommandText(Function parentElement) 
            : base(parentElement)
        { 
        } 

        public string CommandText 
        {
            get { return _commandText; }
        }
 
        protected override bool HandleText(XmlReader reader)
        { 
            _commandText = reader.Value; 
            return true;
        } 

        internal override void Validate()
        {
            base.Validate(); 

            if (String.IsNullOrEmpty(_commandText)) 
            { 
                AddError(ErrorCode.EmptyCommandText, EdmSchemaErrorSeverity.Error,
                    System.Data.Entity.Strings.EmptyCommandText); 
            }
        }
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner       [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 

using System; 
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics; 
using System.Xml;
using System.Data; 
using System.Data.Metadata.Edm; 

namespace System.Data.EntityModel.SchemaObjectModel 
{
    /// 
    /// Represents an CommandText element.
    ///  
    internal sealed class FunctionCommandText : SchemaElement
    { 
        private string _commandText; 

        ///  
        /// Constructs an FunctionCommandText
        /// 
        /// Reference to the schema element.
        public FunctionCommandText(Function parentElement) 
            : base(parentElement)
        { 
        } 

        public string CommandText 
        {
            get { return _commandText; }
        }
 
        protected override bool HandleText(XmlReader reader)
        { 
            _commandText = reader.Value; 
            return true;
        } 

        internal override void Validate()
        {
            base.Validate(); 

            if (String.IsNullOrEmpty(_commandText)) 
            { 
                AddError(ErrorCode.EmptyCommandText, EdmSchemaErrorSeverity.Error,
                    System.Data.Entity.Strings.EmptyCommandText); 
            }
        }
    }
} 

// 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