Timeout() private méthode

private Timeout ( ) : void
Résultat void
        private static void TimerCallback(object state)
        {
            TransactionScope scope = state as TransactionScope;

            if (scope == null)
            {
                if (DiagnosticTrace.Critical)
                {
                    InternalErrorTraceRecord.Trace(System.Transactions.SR.GetString("TraceSourceBase"), System.Transactions.SR.GetString("TransactionScopeTimerObjectInvalid"));
                }
                throw TransactionException.Create(System.Transactions.SR.GetString("TraceSourceBase"), System.Transactions.SR.GetString("InternalError") + System.Transactions.SR.GetString("TransactionScopeTimerObjectInvalid"), null);
            }
            scope.Timeout();
        }
Exemple #2
0
        private static void TimerCallback(object state)
        {
            TransactionScope scope = state as TransactionScope;

            if (null == scope)
            {
                TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
                if (etwLog.IsEnabled())
                {
                    etwLog.TransactionScopeInternalError("TransactionScopeTimerObjectInvalid");
                }

                throw TransactionException.Create(TraceSourceType.TraceSourceBase, SR.InternalError + SR.TransactionScopeTimerObjectInvalid, null);
            }

            scope.Timeout();
        }