[tests] Separate MONO_PATH directories by PLATFORM_PATH_SEPARATOR
[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
11 namespace System.Transactions
12 {
13         public struct TransactionOptions
14         {
15
16                 IsolationLevel level;
17                 TimeSpan timeout;
18
19                 internal TransactionOptions (IsolationLevel level, TimeSpan timeout)
20                 {
21                         this.level = level;
22                         this.timeout = timeout;
23                 }
24
25                 public IsolationLevel IsolationLevel {
26                         get { return level; }
27                         set { level = value; }
28                 }
29
30                 public TimeSpan Timeout {
31                         get { return timeout; }
32                         set { timeout = value; }
33                 }
34
35                 public static bool operator == (TransactionOptions  o1,
36                         TransactionOptions o2)
37                 {
38                         return o1.level == o2.level &&
39                                 o1.timeout == o2.timeout;
40                 }
41
42                 public static bool operator != (TransactionOptions o1,
43                         TransactionOptions o2)
44                 {
45                         return o1.level != o2.level ||
46                                 o1.timeout != o2.timeout;
47                 }
48
49                 public override bool Equals (object obj)
50                 {
51                         if (! (obj is TransactionOptions))
52                                 return false;
53                         return this == (TransactionOptions) obj;
54                 }
55
56                 public override int GetHashCode ()
57                 {
58                         return (int) level ^ timeout.GetHashCode ();
59                 }
60         }
61 }
62