Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Mail / ClosableStream.cs / 1 / ClosableStream.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { using System; using System.IO; using System.Threading; ////// Provides a stream that notifies an event when the Close method /// is called. /// internal class ClosableStream : DelegatedStream { EventHandler onClose; int closed; internal ClosableStream(Stream stream, EventHandler onClose) : base(stream) { this.onClose = onClose; } public override void Close() { if (Interlocked.Increment(ref closed) == 1) if (this.onClose != null) this.onClose(this, new EventArgs()); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CrossContextChannel.cs
- FileStream.cs
- SqlDataSourceAdvancedOptionsForm.cs
- DataGridSortCommandEventArgs.cs
- ClusterRegistryConfigurationProvider.cs
- CodePageUtils.cs
- XmlMtomWriter.cs
- ConfigXmlComment.cs
- SafeProcessHandle.cs
- AncillaryOps.cs
- SelectionPattern.cs
- TemplateLookupAction.cs
- ExpressionEvaluator.cs
- SessionPageStateSection.cs
- QilLiteral.cs
- DbProviderFactories.cs
- TheQuery.cs
- FileFormatException.cs
- ClientSettingsProvider.cs
- TrackingProfileSerializer.cs
- SocketStream.cs
- CompressEmulationStream.cs
- BindingRestrictions.cs
- MemoryStream.cs
- FontFamily.cs
- TransformDescriptor.cs
- linebase.cs
- GridViewUpdatedEventArgs.cs
- SqlDataSourceCache.cs
- SiteMapNode.cs
- ListDataHelper.cs
- HtmlSelect.cs
- Asn1IntegerConverter.cs
- StreamGeometry.cs
- QilNode.cs
- CellTreeNodeVisitors.cs
- EventItfInfo.cs
- NativeMethodsOther.cs
- IdentityHolder.cs
- SchemaCompiler.cs
- x509store.cs
- Material.cs
- WebFormDesignerActionService.cs
- TransactionManager.cs
- mil_commands.cs
- Assembly.cs
- ManagementOperationWatcher.cs
- SourceLineInfo.cs
- _emptywebproxy.cs
- ISAPIRuntime.cs
- RegistrySecurity.cs
- AttributeSetAction.cs
- ErrorRuntimeConfig.cs
- Tokenizer.cs
- MatrixCamera.cs
- CheckBoxFlatAdapter.cs
- ImportContext.cs
- XmlEntity.cs
- BamlReader.cs
- XmlAttributeOverrides.cs
- PixelFormats.cs
- _NetworkingPerfCounters.cs
- ByteStorage.cs
- DBPropSet.cs
- XmlSchemaAnyAttribute.cs
- FileDialog_Vista.cs
- QilReplaceVisitor.cs
- IntegerValidator.cs
- dsa.cs
- WebControlParameterProxy.cs
- GridViewRowCollection.cs
- StringWriter.cs
- CompositeCollection.cs
- RightsManagementInformation.cs
- XmlSchemaObject.cs
- ConfigurationElementCollection.cs
- XmlDocumentSerializer.cs
- Utility.cs
- HttpProcessUtility.cs
- FunctionImportElement.cs
- RegionIterator.cs
- UIElement3D.cs
- FontFamilyConverter.cs
- CodeCommentStatement.cs
- ScaleTransform.cs
- CommandLibraryHelper.cs
- RadioButtonStandardAdapter.cs
- _Events.cs
- DataRowComparer.cs
- ContentPlaceHolderDesigner.cs
- _TLSstream.cs
- EllipseGeometry.cs
- DesignTimeVisibleAttribute.cs
- MSHTMLHostUtil.cs
- File.cs
- WebHttpSecurity.cs
- PocoPropertyAccessorStrategy.cs
- AvTrace.cs
- PiiTraceSource.cs
- HttpValueCollection.cs