TypedTableBase.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataSet / System / Data / TypedTableBase.cs / 1 / TypedTableBase.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
// spather
//----------------------------------------------------------------------------- 
 
using System;
using System.Collections.Generic; 
using System.Collections;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization; 

namespace System.Data { 
 
    /// 
    /// This is the generic base class for TypedDataSet 
    /// 
    [Serializable]
    public abstract class TypedTableBase : DataTable, IEnumerable where T : DataRow {
 
        /// 
        ///   Default constructor for generic TypedTableBase. 
        ///   Will be called by generated Typed DataSet classes and is not for public use. 
        /// 
        protected TypedTableBase() : base() {} 

        /// 
        ///   Constructor for the generic TypedTableBase with takes SerializationInfo and StreamingContext.
        ///   Will be called by generated Typed DataSet classes and 
        ///   is not for public use.
        ///  
        ///  
        ///   SerializationInfo containing data to construct the object.
        ///  
        /// 
        ///   The streaming context for the object being deserializad.
        /// 
        protected TypedTableBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) 
            : base(info, context) {}
 
        ///  
        ///   This property returns a enumerator of T for the TypedTable.  Note, this could
        ///   execute the underlying Linq expression. 
        /// 
        /// 
        ///   IEnumerable of T.
        ///  
        public IEnumerator GetEnumerator() {
            return this.Rows.Cast().GetEnumerator(); 
        } 

        IEnumerator IEnumerable.GetEnumerator() { 
            return GetEnumerator();
        }

 
        /// 
        /// Casts an EnumerableDataTable_TSource into EnumerableDataTable_TResult 
        ///  
        public EnumerableRowCollection Cast()
        { 
            EnumerableRowCollection erc = new EnumerableRowCollection((DataTable)this);
            return erc.Cast();
        }
 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
// spather
//----------------------------------------------------------------------------- 
 
using System;
using System.Collections.Generic; 
using System.Collections;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization; 

namespace System.Data { 
 
    /// 
    /// This is the generic base class for TypedDataSet 
    /// 
    [Serializable]
    public abstract class TypedTableBase : DataTable, IEnumerable where T : DataRow {
 
        /// 
        ///   Default constructor for generic TypedTableBase. 
        ///   Will be called by generated Typed DataSet classes and is not for public use. 
        /// 
        protected TypedTableBase() : base() {} 

        /// 
        ///   Constructor for the generic TypedTableBase with takes SerializationInfo and StreamingContext.
        ///   Will be called by generated Typed DataSet classes and 
        ///   is not for public use.
        ///  
        ///  
        ///   SerializationInfo containing data to construct the object.
        ///  
        /// 
        ///   The streaming context for the object being deserializad.
        /// 
        protected TypedTableBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) 
            : base(info, context) {}
 
        ///  
        ///   This property returns a enumerator of T for the TypedTable.  Note, this could
        ///   execute the underlying Linq expression. 
        /// 
        /// 
        ///   IEnumerable of T.
        ///  
        public IEnumerator GetEnumerator() {
            return this.Rows.Cast().GetEnumerator(); 
        } 

        IEnumerator IEnumerable.GetEnumerator() { 
            return GetEnumerator();
        }

 
        /// 
        /// Casts an EnumerableDataTable_TSource into EnumerableDataTable_TResult 
        ///  
        public EnumerableRowCollection Cast()
        { 
            EnumerableRowCollection erc = new EnumerableRowCollection((DataTable)this);
            return erc.Cast();
        }
 
    }
} 

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