System.Transactions.TransactionScope.SetCurrent C# (CSharp) Method

SetCurrent() private method

private SetCurrent ( Transaction newCurrent ) : void
newCurrent Transaction
return void
        private void SetCurrent(Transaction newCurrent)
        {
            // Keep a dependent clone of current if we don't have one and we are not committable
            if (_dependentTransaction == null && _committableTransaction == null)
            {
                if (newCurrent != null)
                {
                    _dependentTransaction = newCurrent.DependentClone(DependentCloneOption.RollbackIfNotComplete);
                }
            }

            switch (_interopOption)
            {
                case EnterpriseServicesInteropOption.None:
                    _threadContextData.CurrentTransaction = newCurrent;
                    break;

                case EnterpriseServicesInteropOption.Automatic:
                    EnterpriseServices.VerifyEnterpriseServicesOk();
                    if (EnterpriseServices.UseServiceDomainForCurrent())
                    {
                        EnterpriseServices.PushServiceDomain(newCurrent);
                    }
                    else
                    {
                        _threadContextData.CurrentTransaction = newCurrent;
                    }
                    break;

                case EnterpriseServicesInteropOption.Full:
                    EnterpriseServices.VerifyEnterpriseServicesOk();
                    EnterpriseServices.PushServiceDomain(newCurrent);
                    break;
            }
        }