public override void Close() { if (_stream != null) { _downloadManager.Remove(this); _stream.Close(); _stream = null; } }
protected override void Dispose(bool disposing) { try { if (disposing && stream != null) { if (downloadManager != null) { downloadManager.Remove(host); } stream.Close(); } stream = null; GC.SuppressFinalize(this); // do not call finalizer } finally { base.Dispose(disposing); } }