Pair.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 / Core / System / Linq / Parallel / Utils / Pair.cs / 1305376 / Pair.cs

                            // ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
// 
// Pair.cs 
//
// [....] 
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

namespace System.Linq.Parallel 
{
    ///  
    /// A pair just wraps two bits of data into a single addressable unit. This is a 
    /// value type to ensure it remains very lightweight, since it is frequently used
    /// with other primitive data types as well. 
    /// 
    /// 
    /// 
    internal struct Pair 
    {
 
        // The first and second bits of data. 
        internal T m_first;
        internal U m_second; 

        //------------------------------------------------------------------------------------
        // A simple constructor that initializes the first/second fields.
        // 

        public Pair(T first, U second) 
        { 
            m_first = first;
            m_second = second; 
        }

        //-----------------------------------------------------------------------------------
        // Accessors for the left and right data. 
        //
 
        public T First 
        {
            get { return m_first; } 
            set { m_first = value; }
        }

        public U Second 
        {
            get { return m_second; } 
            set { m_second = 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