Files
linux-packaging-mono/mcs/class/System.Transactions/System.Transactions/TransactionOptions.cs
Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

63 lines
1.1 KiB
C#

//
// TransactionOptions.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// (C)2005 Novell Inc,
//
namespace System.Transactions
{
public struct TransactionOptions
{
IsolationLevel level;
TimeSpan timeout;
internal TransactionOptions (IsolationLevel level, TimeSpan timeout)
{
this.level = level;
this.timeout = timeout;
}
public IsolationLevel IsolationLevel {
get { return level; }
set { level = value; }
}
public TimeSpan Timeout {
get { return timeout; }
set { timeout = value; }
}
public static bool operator == (TransactionOptions o1,
TransactionOptions o2)
{
return o1.level == o2.level &&
o1.timeout == o2.timeout;
}
public static bool operator != (TransactionOptions o1,
TransactionOptions o2)
{
return o1.level != o2.level ||
o1.timeout != o2.timeout;
}
public override bool Equals (object obj)
{
if (! (obj is TransactionOptions))
return false;
return this == (TransactionOptions) obj;
}
public override int GetHashCode ()
{
return (int) level ^ timeout.GetHashCode ();
}
}
}