TransactionTraceIdentifier.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 / tx / System / Transactions / TransactionTraceIdentifier.cs / 1305376 / TransactionTraceIdentifier.cs

                            using System; 

namespace System.Transactions
{
    ///  
    /// This identifier is used in tracing to distiguish instances
    /// of transaction objects.  This identifier is only unique within 
    /// a given AppDomain. 
    /// 
    internal struct TransactionTraceIdentifier 
    {
        public static readonly TransactionTraceIdentifier Empty = new TransactionTraceIdentifier();

        public TransactionTraceIdentifier( 
            string transactionIdentifier,
            int cloneIdentifier 
            ) 
        {
            this.transactionIdentifier = transactionIdentifier; 
            this.cloneIdentifier = cloneIdentifier;
        }

        private string transactionIdentifier; 
        /// 
        /// The string representation of the transaction identifier. 
        ///  
        public string TransactionIdentifier
        { 
            get
            {
                return this.transactionIdentifier;
            } 
        }
 
        private int cloneIdentifier; 
        /// 
        /// An integer value that allows different clones of the same 
        /// transaction to be distiguished in the tracing.
        /// 
        public int CloneIdentifier
        { 
            get
            { 
                return this.cloneIdentifier; 
            }
        } 

        public override int GetHashCode()
        {
            return base.GetHashCode();  // Don't have anything better to do. 
        }
 
        public override bool Equals ( object objectToCompare ) 
        {
            if ( ! ( objectToCompare is TransactionTraceIdentifier ) ) 
            {
                return false;
            }
 
            TransactionTraceIdentifier id = (TransactionTraceIdentifier) objectToCompare;
            if ( ( id.TransactionIdentifier != this.TransactionIdentifier ) || 
                ( id.CloneIdentifier != this.CloneIdentifier ) ) 
            {
                return false; 
            }
            return true;
        }
 
        public static bool operator==( TransactionTraceIdentifier id1, TransactionTraceIdentifier id2 )
        { 
            return id1.Equals( id2 ); 
        }
 

        public static bool operator!=( TransactionTraceIdentifier id1, TransactionTraceIdentifier id2 )
        {
            return !id1.Equals( id2 ); 
        }
    } 
} 


// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System; 

namespace System.Transactions
{
    ///  
    /// This identifier is used in tracing to distiguish instances
    /// of transaction objects.  This identifier is only unique within 
    /// a given AppDomain. 
    /// 
    internal struct TransactionTraceIdentifier 
    {
        public static readonly TransactionTraceIdentifier Empty = new TransactionTraceIdentifier();

        public TransactionTraceIdentifier( 
            string transactionIdentifier,
            int cloneIdentifier 
            ) 
        {
            this.transactionIdentifier = transactionIdentifier; 
            this.cloneIdentifier = cloneIdentifier;
        }

        private string transactionIdentifier; 
        /// 
        /// The string representation of the transaction identifier. 
        ///  
        public string TransactionIdentifier
        { 
            get
            {
                return this.transactionIdentifier;
            } 
        }
 
        private int cloneIdentifier; 
        /// 
        /// An integer value that allows different clones of the same 
        /// transaction to be distiguished in the tracing.
        /// 
        public int CloneIdentifier
        { 
            get
            { 
                return this.cloneIdentifier; 
            }
        } 

        public override int GetHashCode()
        {
            return base.GetHashCode();  // Don't have anything better to do. 
        }
 
        public override bool Equals ( object objectToCompare ) 
        {
            if ( ! ( objectToCompare is TransactionTraceIdentifier ) ) 
            {
                return false;
            }
 
            TransactionTraceIdentifier id = (TransactionTraceIdentifier) objectToCompare;
            if ( ( id.TransactionIdentifier != this.TransactionIdentifier ) || 
                ( id.CloneIdentifier != this.CloneIdentifier ) ) 
            {
                return false; 
            }
            return true;
        }
 
        public static bool operator==( TransactionTraceIdentifier id1, TransactionTraceIdentifier id2 )
        { 
            return id1.Equals( id2 ); 
        }
 

        public static bool operator!=( TransactionTraceIdentifier id1, TransactionTraceIdentifier id2 )
        {
            return !id1.Equals( id2 ); 
        }
    } 
} 


// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.

                        

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