Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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()); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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
- Cast.cs
- PathFigureCollectionValueSerializer.cs
- SafeEventLogWriteHandle.cs
- BrowserCapabilitiesFactory.cs
- DrawListViewSubItemEventArgs.cs
- InstalledVoice.cs
- CancellationState.cs
- TextBoxAutoCompleteSourceConverter.cs
- ValidatedControlConverter.cs
- PropertyPathWorker.cs
- Rule.cs
- XmlAnyElementAttribute.cs
- SmiEventSink_Default.cs
- Fonts.cs
- Internal.cs
- ErrorFormatter.cs
- AppSettingsSection.cs
- StackBuilderSink.cs
- TypeConverterHelper.cs
- MonitorWrapper.cs
- TableDetailsRow.cs
- EUCJPEncoding.cs
- HtmlEmptyTagControlBuilder.cs
- CatalogZoneBase.cs
- COMException.cs
- _SslSessionsCache.cs
- WebPartsPersonalizationAuthorization.cs
- MultiView.cs
- SqlXml.cs
- SqlStatistics.cs
- TcpStreams.cs
- ResourceDescriptionAttribute.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- HandleRef.cs
- CssClassPropertyAttribute.cs
- ScriptResourceHandler.cs
- VScrollBar.cs
- WorkflowClientDeliverMessageWrapper.cs
- TextSelection.cs
- PrefixQName.cs
- ReliableMessagingVersionConverter.cs
- Root.cs
- Keywords.cs
- SearchExpression.cs
- Help.cs
- BaseValidator.cs
- SendReply.cs
- DPCustomTypeDescriptor.cs
- LabelEditEvent.cs
- CharAnimationUsingKeyFrames.cs
- ListItemConverter.cs
- HttpContext.cs
- DataGridHeaderBorder.cs
- XmlCDATASection.cs
- HealthMonitoringSectionHelper.cs
- ProviderCommandInfoUtils.cs
- SqlDataReaderSmi.cs
- XmlValidatingReader.cs
- SchemaEntity.cs
- RtfToken.cs
- RadioButtonRenderer.cs
- SendMessageChannelCache.cs
- LoginUtil.cs
- MenuCommandsChangedEventArgs.cs
- InstanceDataCollectionCollection.cs
- PagedDataSource.cs
- GroupAggregateExpr.cs
- IEnumerable.cs
- ReceiveActivityDesigner.cs
- DataObject.cs
- LinqDataSourceSelectEventArgs.cs
- TextEditorSpelling.cs
- SqlReferenceCollection.cs
- DomNameTable.cs
- XamlSerializationHelper.cs
- CellParaClient.cs
- WrappedIUnknown.cs
- ProvideValueServiceProvider.cs
- XpsSerializerWriter.cs
- ObjectKeyFrameCollection.cs
- ByeMessageApril2005.cs
- DataBindingList.cs
- ObjectTag.cs
- AliasGenerator.cs
- SystemWebSectionGroup.cs
- HyperlinkAutomationPeer.cs
- XmlIncludeAttribute.cs
- AnnotationStore.cs
- BitVector32.cs
- EntityDataSourceDesignerHelper.cs
- AppDomainManager.cs
- SqlUDTStorage.cs
- Utility.cs
- DynamicVirtualDiscoSearcher.cs
- SerialReceived.cs
- XmlSchemaSimpleContentRestriction.cs
- Visual3D.cs
- StartUpEventArgs.cs
- AsymmetricSecurityProtocolFactory.cs
- UICuesEvent.cs