diff options
author | Tuomas Hietanen <tuomas.hietanen@iki.fi> | 2016-05-27 12:40:09 +0300 |
---|---|---|
committer | Tuomas Hietanen <tuomas.hietanen@iki.fi> | 2016-05-27 12:40:09 +0300 |
commit | 1516f24d06549c7ebd6eaea95a6c5415119e69e3 (patch) | |
tree | d4794f6ff0ccfbe7d7cb9b320e779346389598fb /mcs/class/System.Transactions | |
parent | 820be6c036aa7216b03317c3e58be64d5c053028 (diff) |
Made changes suggested by marek.
Diffstat (limited to 'mcs/class/System.Transactions')
3 files changed, 61 insertions, 60 deletions
diff --git a/mcs/class/System.Transactions/System.Transactions.dll.sources b/mcs/class/System.Transactions/System.Transactions.dll.sources index 36d981ebe95..4c5394f957b 100644 --- a/mcs/class/System.Transactions/System.Transactions.dll.sources +++ b/mcs/class/System.Transactions/System.Transactions.dll.sources @@ -31,6 +31,7 @@ System.Transactions/TransactionManagerCommunicationException.cs System.Transactions/TransactionOptions.cs System.Transactions/TransactionPromotionException.cs System.Transactions/TransactionScope.cs +System.Transactions/TransactionScopeAsyncFlowOption.cs System.Transactions/TransactionScopeOption.cs System.Transactions/TransactionStatus.cs System.Transactions/Configuration/DefaultSettingsSection.cs diff --git a/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs b/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs index 9c0c353ba24..8ec40403b06 100644 --- a/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs +++ b/mcs/class/System.Transactions/System.Transactions/TransactionScope.cs @@ -31,21 +31,21 @@ namespace System.Transactions bool completed; bool isRoot; - bool asyncFlowEnabled; + bool asyncFlowEnabled; - public TransactionScope () + public TransactionScope () : this (TransactionScopeOption.Required, TransactionManager.DefaultTimeout) { } - public TransactionScope(TransactionScopeAsyncFlowOption asyncFlow) - : this(TransactionScopeOption.Required, - TransactionManager.DefaultTimeout, asyncFlow) - { - } + public TransactionScope(TransactionScopeAsyncFlowOption asyncFlow) + : this(TransactionScopeOption.Required, + TransactionManager.DefaultTimeout, asyncFlow) + { + } - public TransactionScope (Transaction transaction) + public TransactionScope (Transaction transaction) : this (transaction, TransactionManager.DefaultTimeout) { } @@ -69,12 +69,12 @@ namespace System.Transactions { } - public TransactionScope(TransactionScopeOption option, TransactionScopeAsyncFlowOption asyncFlow) - : this(option, TransactionManager.DefaultTimeout, asyncFlow) - { - } + public TransactionScope(TransactionScopeOption option, TransactionScopeAsyncFlowOption asyncFlow) + : this(option, TransactionManager.DefaultTimeout, asyncFlow) + { + } - public TransactionScope (TransactionScopeOption option, + public TransactionScope (TransactionScopeOption option, TimeSpan timeout, TransactionScopeAsyncFlowOption asyncFlow) { Initialize (option, null, defaultOptions, @@ -103,9 +103,9 @@ namespace System.Transactions completed = false; isRoot = false; nested = 0; - asyncFlowEnabled = asyncFlow == TransactionScopeAsyncFlowOption.Enabled; + asyncFlowEnabled = asyncFlow == TransactionScopeAsyncFlowOption.Enabled; - if (timeout < TimeSpan.Zero) + if (timeout < TimeSpan.Zero) throw new ArgumentOutOfRangeException ("timeout"); this.timeout = timeout; @@ -188,61 +188,61 @@ namespace System.Transactions throw new InvalidOperationException ("Transaction.Current has changed inside of the TransactionScope"); } - if (asyncFlowEnabled) { - if (oldTransaction != null) - oldTransaction.Scope = parentScope; + if (asyncFlowEnabled) { + if (oldTransaction != null) + oldTransaction.Scope = parentScope; - var variedTransaction = Transaction.CurrentInternal; + var variedTransaction = Transaction.CurrentInternal; - if (transaction == null && variedTransaction == null) - /* scope was not in a transaction, (Suppress) */ - return; + if (transaction == null && variedTransaction == null) + /* scope was not in a transaction, (Suppress) */ + return; - variedTransaction.Scope = parentScope; - Transaction.CurrentInternal = oldTransaction; + variedTransaction.Scope = parentScope; + Transaction.CurrentInternal = oldTransaction; - transaction.Scope = null; + transaction.Scope = null; - if (!IsComplete) { - transaction.Rollback (); - variedTransaction.Rollback(); - return; - } + if (!IsComplete) { + transaction.Rollback (); + variedTransaction.Rollback(); + return; + } - if (!isRoot) - /* Non-root scope has completed+ended */ - return; + if (!isRoot) + /* Non-root scope has completed+ended */ + return; - variedTransaction.CommitInternal(); - transaction.CommitInternal(); - } else { - if (Transaction.CurrentInternal == oldTransaction && oldTransaction != null) - oldTransaction.Scope = parentScope; + variedTransaction.CommitInternal(); + transaction.CommitInternal(); + } else { + if (Transaction.CurrentInternal == oldTransaction && oldTransaction != null) + oldTransaction.Scope = parentScope; - Transaction.CurrentInternal = oldTransaction; + Transaction.CurrentInternal = oldTransaction; - if (transaction == null) - /* scope was not in a transaction, (Suppress) */ - return; + if (transaction == null) + /* scope was not in a transaction, (Suppress) */ + return; - transaction.Scope = null; + transaction.Scope = null; - if (!IsComplete) - { - transaction.Rollback(); - return; - } + if (!IsComplete) + { + transaction.Rollback(); + return; + } - if (!isRoot) - /* Non-root scope has completed+ended */ - return; + if (!isRoot) + /* Non-root scope has completed+ended */ + return; - transaction.CommitInternal(); + transaction.CommitInternal(); - } - } + } + } - } + } } diff --git a/mcs/class/System.Transactions/System.Transactions/TransactionScopeAsyncFlowOption.cs b/mcs/class/System.Transactions/System.Transactions/TransactionScopeAsyncFlowOption.cs index f1c941979a3..5285fe5a0fd 100644 --- a/mcs/class/System.Transactions/System.Transactions/TransactionScopeAsyncFlowOption.cs +++ b/mcs/class/System.Transactions/System.Transactions/TransactionScopeAsyncFlowOption.cs @@ -1,9 +1,9 @@ namespace System.Transactions { - public enum TransactionScopeAsyncFlowOption - { - Suppress, - Enabled - } + public enum TransactionScopeAsyncFlowOption + { + Suppress, + Enabled + } } |