Implemented overloaded versions of Parse and TryParse functions for BigInteger.
[mono.git] / mcs / class / System.Transactions / System.Transactions / PreparingEnlistment.cs
1 //
2 // PreparingEnlistment.cs
3 //
4 // Author:
5 //      Atsushi Enomoto  <atsushi@ximian.com>
6 //      Ankit Jain       <JAnkit@novell.com>
7 //
8 // (C)2005 Novell Inc,
9 // (C)2006 Novell Inc,
10 //
11
12 #if NET_2_0
13
14 using System.Threading;
15
16 namespace System.Transactions
17 {
18         public class PreparingEnlistment : Enlistment
19         {
20                 bool prepared = false;
21                 Transaction tx;
22                 IEnlistmentNotification enlisted;
23                 WaitHandle waitHandle;
24                 Exception ex;
25
26                 internal PreparingEnlistment (Transaction tx, IEnlistmentNotification enlisted)
27                 {
28                         this.tx = tx;
29                         this.enlisted = enlisted;
30                         waitHandle = new ManualResetEvent (false);
31                 }
32
33                 public void ForceRollback ()
34                 {
35                         ForceRollback (null);
36                 }
37
38                 [MonoTODO]
39                 public void ForceRollback (Exception ex)
40                 {
41                         tx.Rollback (ex, enlisted);
42                         /* See test RMFail2 */
43                         ((ManualResetEvent) waitHandle).Set ();
44                 }
45
46                 [MonoTODO]
47                 public void Prepared ()
48                 {
49                         prepared = true;
50                         /* See test RMFail2 */
51                         ((ManualResetEvent) waitHandle).Set ();
52                 }
53
54                 [MonoTODO]
55                 public byte [] RecoveryInformation ()
56                 {
57                         throw new NotImplementedException ();
58                 }
59
60                 internal bool IsPrepared {
61                         get { return prepared; }
62                 }
63
64                 internal WaitHandle WaitHandle {
65                         get { return waitHandle; }
66                 }
67
68                 internal IEnlistmentNotification EnlistmentNotification
69                 {
70                         get { return enlisted; }
71                 }
72
73                 // Uncatched exceptions thrown during prepare will
74                 // be saved here so they can be retrieved by TM.
75                 internal Exception Exception
76                 {
77                         get { return ex; }
78                         set { ex = value; }
79                 }
80         }
81 }
82
83 #endif