Fixed conding style and added license/copyright header to new files
authorPablo Ruiz Garcia <pablo.ruiz@gmail.com>
Sun, 3 Oct 2010 18:19:49 +0000 (02:19 +0800)
committerMiguel de Icaza <miguel@gnome.org>
Sun, 3 Oct 2010 21:20:37 +0000 (05:20 +0800)
mcs/class/System.Transactions/System.Transactions/Configuration/DefaultSettingsSection.cs
mcs/class/System.Transactions/System.Transactions/Configuration/MachineSettingsSection.cs
mcs/class/System.Transactions/System.Transactions/Configuration/TransactionsSectionGroup.cs
mcs/class/System.Transactions/System.Transactions/Transaction.cs
mcs/class/System.Transactions/System.Transactions/TransactionManager.cs
mcs/class/System.Transactions/Test/EnlistTest.cs

index 315f326bd74ae0262e726ad67a11c04b9591def2..2992a730c47aa46f3c34350d4e7b879811a55b2d 100644 (file)
@@ -1,3 +1,14 @@
+//\r
+// DefaultSettingsSection.cs\r
+//\r
+// Author:\r
+//     Pablo Ruiz <pruiz@netway.org>\r
+//\r
+// (C) 2010 Pablo Ruiz.\r
+//
+
+#if NET_2_0
+
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -8,8 +19,8 @@ namespace System.Transactions.Configuration
        public class DefaultSettingsSection : ConfigurationSection
        {
                // http://msdn.microsoft.com/en-us/library/system.transactions.configuration.defaultsettingssection.timeout.aspx
-               [ConfigurationProperty("timeout", DefaultValue = "00:01:00")]
-               [TimeSpanValidator(MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")]
+               [ConfigurationProperty ("timeout", DefaultValue = "00:01:00")]
+               [TimeSpanValidator (MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")]
                public TimeSpan Timeout {
                        get { return (TimeSpan)base["timeout"]; }
                        set {  
@@ -19,10 +30,11 @@ namespace System.Transactions.Configuration
                }
 
                // http://msdn.microsoft.com/en-us/library/system.transactions.configuration.defaultsettingssection.distributedtransactionmanagername(v=VS.90).aspx
-               [ConfigurationProperty("distributedTransactionManagerName", DefaultValue = "")]
+               [ConfigurationProperty ("distributedTransactionManagerName", DefaultValue = "")]
                public string DistributedTransactionManagerName {
                        get { return base["distributedTransactionManagerName"] as string; }
                        set { base["distributedTransactionManagerName"] = value; }
                }
        }
 }
+#endif
\ No newline at end of file
index a86c2d9bd11566a10d482193b51420239cbb657a..5de518665fa4540437966784f890831831b24a56 100644 (file)
@@ -1,3 +1,14 @@
+//\r
+// MachineSettingsSection.cs\r
+//\r
+// Author:\r
+//     Pablo Ruiz <pruiz@netway.org>\r
+//\r
+// (C) 2010 Pablo Ruiz.\r
+//
+
+#if NET_2_0
+
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -19,3 +30,4 @@ namespace System.Transactions.Configuration
                }
        }
 }
+#endif
\ No newline at end of file
index b046f7deb6e354c200c77667d00ddd494737995c..a43d9a99313fc3cf4effba5341a5113df2dcc2b5 100644 (file)
@@ -1,3 +1,14 @@
+//\r
+// TransactionSectionGroup.cs\r
+//\r
+// Author:\r
+//     Pablo Ruiz <pruiz@netway.org>\r
+//\r
+// (C) 2010 Pablo Ruiz.\r
+//
+
+#if NET_2_0
+
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -29,3 +40,4 @@ namespace System.Transactions.Configuration
                }
        }
 }
+#endif
\ No newline at end of file
index ef8d97baa23bb1eec1cd9a025acf5188bdccb21f..b4d8b12b383132070e7ebbe7980df44d5ef09a55 100644 (file)
@@ -235,7 +235,7 @@ namespace System.Transactions
                {\r
                        if (aborted)\r
                        {\r
-                               FireCompleted();\r
+                               FireCompleted ();\r
                                return;\r
                        }
 
@@ -254,7 +254,7 @@ namespace System.Transactions
 
                        Aborted = true;\r
 \r
-                       FireCompleted();
+                       FireCompleted ();
                }
 
                bool Aborted {
@@ -348,7 +348,7 @@ namespace System.Transactions
                        if (!aborted)
                                info.Status = TransactionStatus.Committed;\r
 \r
-                       FireCompleted();\r
+                       FireCompleted ();\r
                }
 
                internal void InitScope (TransactionScope scope)
@@ -374,8 +374,8 @@ namespace System.Transactions
                        // Call prepare on all volatile managers.\r
                        foreach (IEnlistmentNotification enlist in volatiles)\r
                        {\r
-                               PreparingEnlistment pe = new PreparingEnlistment(this, enlist);\r
-                               ThreadPool.QueueUserWorkItem(new WaitCallback(PrepareCallbackWrapper), pe);\r
+                               PreparingEnlistment pe = new PreparingEnlistment (this, enlist);\r
+                               ThreadPool.QueueUserWorkItem (new WaitCallback(PrepareCallbackWrapper), pe);\r
 \r
                                /* Wait (with timeout) for manager to prepare */\r
                                TimeSpan timeout = Scope != null ? Scope.Timeout : TransactionManager.DefaultTimeout;\r
@@ -426,10 +426,10 @@ namespace System.Transactions
                                throw new TransactionAbortedException ("Transaction has aborted", innerException);
                }\r
 \r
-               void FireCompleted()\r
+               void FireCompleted ()\r
                {\r
                        if (TransactionCompleted != null)\r
-                               TransactionCompleted(this, new TransactionEventArgs(this));\r
+                               TransactionCompleted (this, new TransactionEventArgs(this));\r
                }
 
                static void EnsureIncompleteCurrentScope ()
index feb62fc7e07dfbd4f8f27365c64739c139b24db5..a7a62b6388e559e3045f7dc5effcfaa16d94243f 100644 (file)
@@ -16,16 +16,16 @@ namespace System.Transactions
 {
        public static class TransactionManager
        {
-               static TransactionManager()
+               static TransactionManager ()
                {\r
-                       defaultSettings = ConfigurationManager.GetSection("system.transactions/defaultSettings") as DefaultSettingsSection;\r
-                       machineSettings = ConfigurationManager.GetSection("system.transactions/machineSettings") as MachineSettingsSection;
+                       defaultSettings = ConfigurationManager.GetSection ("system.transactions/defaultSettings") as DefaultSettingsSection;\r
+                       machineSettings = ConfigurationManager.GetSection ("system.transactions/machineSettings") as MachineSettingsSection;
                }\r
 \r
                static DefaultSettingsSection defaultSettings;\r
                static MachineSettingsSection machineSettings;\r
-               static TimeSpan defaultTimeout = new TimeSpan(0, 1, 0); /* 60 secs */\r
-               static TimeSpan maxTimeout = new TimeSpan(0, 10, 0); /* 10 mins */
+               static TimeSpan defaultTimeout = new TimeSpan (0, 1, 0); /* 60 secs */\r
+               static TimeSpan maxTimeout = new TimeSpan (0, 10, 0); /* 10 mins */
 
                public static TimeSpan DefaultTimeout {\r
                        get {\r
index 23d1856dacae816834a135628705fe5d552bab0c..9d820c18b85295ea6c07082d2bddc85063297107 100644 (file)
@@ -560,28 +560,28 @@ namespace MonoTests.System.Transactions {
                public void TransactionCompleted_Committed ()\r
                {\r
                        bool called = false;\r
-                       using (var ts = new TransactionScope())\r
+                       using (var ts = new TransactionScope ())\r
                        {\r
                                var tr = Transaction.Current;\r
                                tr.TransactionCompleted += (s, e) => called = true;\r
-                               ts.Complete();\r
+                               ts.Complete ();\r
                        }\r
 \r
-                       Assert.IsTrue(called, "TransactionCompleted event handler not called!");\r
+                       Assert.IsTrue (called, "TransactionCompleted event handler not called!");\r
                }\r
 \r
                [Test]\r
                public void TransactionCompleted_Rollback ()\r
                {\r
                        bool called = false;\r
-                       using (var ts = new TransactionScope())\r
+                       using (var ts = new TransactionScope ())\r
                        {\r
                                var tr = Transaction.Current;\r
                                tr.TransactionCompleted += (s, e) => called = true;\r
                                // Not calling ts.Complete() on purpose..\r
                        }\r
 \r
-                       Assert.IsTrue(called, "TransactionCompleted event handler not called!");\r
+                       Assert.IsTrue (called, "TransactionCompleted event handler not called!");\r
                }
                #endregion