GlobalItem.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / GlobalItem.cs / 1305376 / GlobalItem.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner       [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 
using System;
using System.Collections.Generic; 
using System.Collections.ObjectModel;
using System.Data.Common;
using System.Diagnostics;
using System.Text; 
using System.Xml.Serialization;
using System.Xml.Schema; 
using System.Xml; 

namespace System.Data.Metadata.Edm 
{
    /// 
    /// Represents the base item class for all the metadata
    ///  
    public abstract class GlobalItem : MetadataItem
    { 
        #region Constructors 
        /// 
        /// Implementing this internal constructor so that this class can't be derived 
        /// outside this assembly
        /// 
        internal GlobalItem()
        { 
        }
 
        internal GlobalItem(MetadataFlags flags) 
            : base(flags)
        { 
        }
        #endregion

        #region Properties 

        ///  
        /// Returns the DataSpace in which this type belongs to 
        /// 
        [MetadataProperty(typeof(DataSpace), false)] 
        internal DataSpace DataSpace
        {
            get
            { 
                // Since there can be row types that span across spaces and we can have collections to such row types, we need to exclude RowType and collection type in this assert check
                Debug.Assert(GetDataSpace() != (DataSpace)(-1) || this.BuiltInTypeKind == BuiltInTypeKind.RowType || this.BuiltInTypeKind == BuiltInTypeKind.CollectionType, "DataSpace must have some valid value"); 
                return GetDataSpace(); 
            }
            set 
            {
                // Whenever you assign the data space value, it must be unassigned or re-assigned to the same value.
                // The only exception being we sometimes need to create row types that contains types from various spaces
                Debug.Assert(GetDataSpace() == (DataSpace)(-1) || GetDataSpace() == value || this.BuiltInTypeKind == BuiltInTypeKind.RowType || this.BuiltInTypeKind == BuiltInTypeKind.CollectionType, "Invalid Value being set for DataSpace"); 
                SetDataSpace(value);
            } 
        } 
        #endregion
    } 
}

// 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.Generic; 
using System.Collections.ObjectModel;
using System.Data.Common;
using System.Diagnostics;
using System.Text; 
using System.Xml.Serialization;
using System.Xml.Schema; 
using System.Xml; 

namespace System.Data.Metadata.Edm 
{
    /// 
    /// Represents the base item class for all the metadata
    ///  
    public abstract class GlobalItem : MetadataItem
    { 
        #region Constructors 
        /// 
        /// Implementing this internal constructor so that this class can't be derived 
        /// outside this assembly
        /// 
        internal GlobalItem()
        { 
        }
 
        internal GlobalItem(MetadataFlags flags) 
            : base(flags)
        { 
        }
        #endregion

        #region Properties 

        ///  
        /// Returns the DataSpace in which this type belongs to 
        /// 
        [MetadataProperty(typeof(DataSpace), false)] 
        internal DataSpace DataSpace
        {
            get
            { 
                // Since there can be row types that span across spaces and we can have collections to such row types, we need to exclude RowType and collection type in this assert check
                Debug.Assert(GetDataSpace() != (DataSpace)(-1) || this.BuiltInTypeKind == BuiltInTypeKind.RowType || this.BuiltInTypeKind == BuiltInTypeKind.CollectionType, "DataSpace must have some valid value"); 
                return GetDataSpace(); 
            }
            set 
            {
                // Whenever you assign the data space value, it must be unassigned or re-assigned to the same value.
                // The only exception being we sometimes need to create row types that contains types from various spaces
                Debug.Assert(GetDataSpace() == (DataSpace)(-1) || GetDataSpace() == value || this.BuiltInTypeKind == BuiltInTypeKind.RowType || this.BuiltInTypeKind == BuiltInTypeKind.CollectionType, "Invalid Value being set for DataSpace"); 
                SetDataSpace(value);
            } 
        } 
        #endregion
    } 
}

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