Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / ClosableStream.cs / 1305376 / 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()); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeMemberField.cs
- ExceptionUtil.cs
- NestedContainer.cs
- DbParameterCollectionHelper.cs
- mediapermission.cs
- FontSource.cs
- IteratorAsyncResult.cs
- SudsWriter.cs
- CalendarModeChangedEventArgs.cs
- FigureHelper.cs
- FileVersion.cs
- XmlParser.cs
- HyperLinkColumn.cs
- DataKey.cs
- BufferedGraphics.cs
- DataBoundControl.cs
- MessagePartDescriptionCollection.cs
- Stackframe.cs
- AdRotator.cs
- ProxyWebPartManager.cs
- ThrowHelper.cs
- SingleQueryOperator.cs
- MenuTracker.cs
- XmlWellformedWriter.cs
- SqlComparer.cs
- DataSysAttribute.cs
- COM2FontConverter.cs
- RelationshipManager.cs
- KeyTime.cs
- WindowsGraphicsCacheManager.cs
- TypeValidationEventArgs.cs
- QilReference.cs
- Point.cs
- SmtpFailedRecipientException.cs
- WindowsPen.cs
- SqlConnectionPoolProviderInfo.cs
- TcpStreams.cs
- CollectionBase.cs
- SafeReadContext.cs
- BuilderElements.cs
- ParagraphVisual.cs
- ParallelTimeline.cs
- DynamicUpdateCommand.cs
- SystemGatewayIPAddressInformation.cs
- DiagnosticsConfigurationHandler.cs
- designeractionbehavior.cs
- VisualStateChangedEventArgs.cs
- IndentedWriter.cs
- SelectionBorderGlyph.cs
- TreeViewImageIndexConverter.cs
- DoubleUtil.cs
- METAHEADER.cs
- RenderingBiasValidation.cs
- ManipulationDeltaEventArgs.cs
- ThumbButtonInfo.cs
- ActionFrame.cs
- SqlNodeAnnotation.cs
- Soap.cs
- HandlerBase.cs
- SerTrace.cs
- ReadOnlyDataSource.cs
- ThreadExceptionEvent.cs
- SimpleType.cs
- Variant.cs
- Utility.cs
- SiteOfOriginContainer.cs
- PingReply.cs
- IsolatedStorageFileStream.cs
- CodeDomLoader.cs
- WebPartMovingEventArgs.cs
- ToolBarTray.cs
- SQLMoneyStorage.cs
- SourceFileInfo.cs
- StringOutput.cs
- LongAverageAggregationOperator.cs
- InteropAutomationProvider.cs
- SlotInfo.cs
- OleDbCommandBuilder.cs
- DropTarget.cs
- AutoGeneratedField.cs
- ParenthesizePropertyNameAttribute.cs
- ModulesEntry.cs
- ModelItemDictionary.cs
- SafeProcessHandle.cs
- SQLInt64.cs
- LayoutDump.cs
- RemoveStoryboard.cs
- HttpRuntimeSection.cs
- SortFieldComparer.cs
- BindingManagerDataErrorEventArgs.cs
- CodeDefaultValueExpression.cs
- Size.cs
- CodeRemoveEventStatement.cs
- HitTestResult.cs
- CqlQuery.cs
- EntityParameter.cs
- SHA512.cs
- WorkflowWebHostingModule.cs
- ValueConversionAttribute.cs
- StorageInfo.cs