public void Dispose() { if (!_disposed) { _disposed = true; _wrappedScope.Dispose(); // must be last if (DecrementNestLevel() == 0) { // top level scope ended Check.Ensure(TopLevelScope == this); TopLevelScope = null; } } }