merged Sys.Web.Services 2.0 support in my branch:
[mono.git] / mcs / class / System.Transactions / System.Transactions / TransactionOptions.cs
1 //
2 // TransactionOptions.cs
3 //
4 // Author:
5 //      Atsushi Enomoto  <atsushi@ximian.com>
6 //
7 // (C)2005 Novell Inc,
8 //
9
10 #if NET_2_0
11
12 namespace System.Transactions
13 {
14         public struct TransactionOptions
15         {
16
17                 IsolationLevel level;
18                 TimeSpan timeout;
19
20                 internal TransactionOptions (IsolationLevel level, TimeSpan timeout)
21                 {
22                         this.level = level;
23                         this.timeout = timeout;
24                 }
25
26                 public IsolationLevel IsolationLevel {
27                         get { return level; }
28                         set { level = value; }
29                 }
30
31                 public TimeSpan Timeout {
32                         get { return timeout; }
33                         set { timeout = value; }
34                 }
35
36                 public static bool operator == (TransactionOptions  o1,
37                         TransactionOptions o2)
38                 {
39                         return o1.level == o2.level &&
40                                 o1.timeout == o2.timeout;
41                 }
42
43                 public static bool operator != (TransactionOptions o1,
44                         TransactionOptions o2)
45                 {
46                         return o1.level != o2.level ||
47                                 o1.timeout != o2.timeout;
48                 }
49
50                 public override bool Equals (object obj)
51                 {
52                         if (! (obj is TransactionOptions))
53                                 return false;
54                         return this == (TransactionOptions) obj;
55                 }
56
57                 public override int GetHashCode ()
58                 {
59                         return (int) level ^ timeout.GetHashCode ();
60                 }
61         }
62 }
63
64 #endif