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

                            using System; 
using System.Security.Permissions;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
 
namespace System.Transactions
{ 
    public struct TransactionOptions 
    {
        private TimeSpan timeout; 
        private System.Transactions.IsolationLevel isolationLevel;

        public TimeSpan Timeout
        { 
            get { return this.timeout; }
            set { this.timeout = value; } 
        } 

        public System.Transactions.IsolationLevel IsolationLevel 
        {
            get { return this.isolationLevel; }
            set { this.isolationLevel = value; }
        } 

 
        public override int GetHashCode() 
        {
            return base.GetHashCode();  // Don't have anything better to do. 
        }


        public override bool Equals( object obj ) 
        {
            if( !(obj is TransactionOptions) ) 
            { 
                // Can't use 'as' for a value type
                return false; 
            }
            TransactionOptions opts = (TransactionOptions)obj;

            return (opts.timeout == this.timeout) && (opts.isolationLevel == this.isolationLevel); 
        }
 
 
        // Changing paramater names would be a breaking change for little benefit.
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] 
        public static bool operator==( TransactionOptions x, TransactionOptions y )
        {
            return x.Equals( y );
        } 

 
        // Changing paramater names would be a breaking change for little benefit. 
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
        public static bool operator!=( TransactionOptions x, TransactionOptions y ) 
        {
            return !x.Equals( y );
        }
    } 
}

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