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
- WebServiceEnumData.cs
- ToolboxItem.cs
- HttpApplication.cs
- ParallelTimeline.cs
- Token.cs
- NameSpaceExtractor.cs
- CodeTypeReferenceCollection.cs
- _HeaderInfoTable.cs
- FullTextBreakpoint.cs
- SiteMapNodeItem.cs
- PropertyCondition.cs
- XmlTextReader.cs
- GenericIdentity.cs
- NullReferenceException.cs
- XsdBuilder.cs
- TableSectionStyle.cs
- ProtocolsConfiguration.cs
- IssuedSecurityTokenParameters.cs
- StyleCollection.cs
- DBSchemaTable.cs
- Expression.cs
- DataServiceBehavior.cs
- BasicKeyConstraint.cs
- SizeF.cs
- XPathDocumentIterator.cs
- AsymmetricSignatureDeformatter.cs
- RegisteredDisposeScript.cs
- Type.cs
- PerspectiveCamera.cs
- VariableAction.cs
- LinqExpressionNormalizer.cs
- DoubleAnimationUsingKeyFrames.cs
- WebPartDeleteVerb.cs
- HttpResponseBase.cs
- CodeAccessSecurityEngine.cs
- SystemEvents.cs
- DecimalAnimationBase.cs
- RequestCacheManager.cs
- XmlAttributeAttribute.cs
- PropertyGroupDescription.cs
- ServiceHttpModule.cs
- WebPartTracker.cs
- MarkupWriter.cs
- DispatcherExceptionFilterEventArgs.cs
- CssClassPropertyAttribute.cs
- LinkedList.cs
- DataGridTemplateColumn.cs
- SchemaImporter.cs
- MenuStrip.cs
- KeyTime.cs
- IntSecurity.cs
- WindowCollection.cs
- EntityDataSourceWrapperCollection.cs
- CodeIdentifier.cs
- DemultiplexingClientMessageFormatter.cs
- XPathItem.cs
- AsymmetricKeyExchangeFormatter.cs
- ArgumentFixer.cs
- MessageAction.cs
- FrameworkElement.cs
- SerializationAttributes.cs
- DataGridViewAdvancedBorderStyle.cs
- UnsafeNativeMethods.cs
- ConfigurationValidatorAttribute.cs
- CounterCreationData.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- ItemCollection.cs
- FormViewCommandEventArgs.cs
- DbSetClause.cs
- ProcessHostFactoryHelper.cs
- TextTreeUndoUnit.cs
- WebPartsSection.cs
- QueuePathEditor.cs
- HtmlTableCellCollection.cs
- Model3DCollection.cs
- HttpSessionStateWrapper.cs
- BitmapEffectGroup.cs
- FontWeightConverter.cs
- StylusPointPropertyId.cs
- StrokeCollectionDefaultValueFactory.cs
- CodeArrayCreateExpression.cs
- PrimaryKeyTypeConverter.cs
- DesignerVerbCollection.cs
- ToolStripOverflow.cs
- WebPartEditorOkVerb.cs
- GeneralTransform2DTo3DTo2D.cs
- GraphicsPath.cs
- HttpResponseWrapper.cs
- LinqDataSourceDeleteEventArgs.cs
- CompositeDispatchFormatter.cs
- FacetDescription.cs
- EventArgs.cs
- StackOverflowException.cs
- XdrBuilder.cs
- HttpClientChannel.cs
- Vertex.cs
- PopOutPanel.cs
- DataGridColumnCollection.cs
- TagMapCollection.cs
- TypeGeneratedEventArgs.cs