public void Dispose(bool disposing)
            {
                if (disposing)
                {
                    try
                    {
                        if (_disposed)
                        {
                            throw new ObjectDisposedException(typeof(ThreadDataManagerData).FullName);
                        }

                        _disposed = true;

                        if (_disposeData)
                        {
                            try
                            {
                                _threadData.Dispose();
                            }
                            catch (Exception e)
                            {
                                Log.LogError(LogTitle, e);
                            }

                            Verify.IsTrue(Current == _threadData,
                                          "ThreadDataManager.Current points to a different thread data object!!!");
                        }
                    }
                    finally
                    {
                        _threadDataManagerData = _threadDataValueToBeRestored;
                    }
                }
                else
                {
                    if (!_disposed && _disposeData)
                    {
                        try
                        {
                            _threadData.Dispose();
                        }
                        catch (Exception)
                        {
                            // silent...
                        }
                    }
                }
            }
Exemplo n.º 2
0
            public void Dispose()
            {
                try
                {
                    if (_disposed)
                    {
                        throw new ObjectDisposedException(typeof(ThreadDataManagerData).FullName);
                    }

                    _disposed = true;

                    if (_disposeData)
                    {
                        try
                        {
                            _threadData.Dispose();
                        }
                        catch (Exception e)
                        {
                            Core.Logging.LoggingService.LogError(LogTitle, e);
                        }

                        Verify.IsTrue(Current == _threadData, "ThreadDataManager.Current points to a different thread data object!!!");
                    }
                }
                finally
                {
                    _threadDataManagerData = _threadDataValueToBeRestored;
                }
            }