New test.
[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
25                 internal PreparingEnlistment (Transaction tx, IEnlistmentNotification enlisted)
26                 {
27                         this.tx = tx;
28                         this.enlisted = enlisted;
29                         //waitHandle = new ManualResetEvent (false);
30                 }
31
32                 public void ForceRollback ()
33                 {
34                         ForceRollback (null);
35                 }
36
37                 [MonoTODO]
38                 public void ForceRollback (Exception ex)
39                 {
40                         tx.Rollback (ex, enlisted);
41                         /* See test RMFail2 
42                         ((ManualResetEvent) waitHandle).Set (); */
43                 }
44
45                 [MonoTODO]
46                 public void Prepared ()
47                 {
48                         prepared = true;
49                         /* See test RMFail2 
50                         ((ManualResetEvent) waitHandle).Set ();*/
51                 }
52
53                 [MonoTODO]
54                 public byte [] RecoveryInformation ()
55                 {
56                         throw new NotImplementedException ();
57                 }
58
59                 internal bool IsPrepared {
60                         get { return prepared; }
61                 }
62
63                 /*internal WaitHandle WaitHandle {
64                         get { return waitHandle; }
65                 }*/
66         }
67 }
68
69 #endif