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
- NavigationWindow.cs
- DataGridViewColumnCollection.cs
- ProcessingInstructionAction.cs
- CrossContextChannel.cs
- BackStopAuthenticationModule.cs
- ExcCanonicalXml.cs
- ComponentSerializationService.cs
- CommonProperties.cs
- OLEDB_Util.cs
- InputQueue.cs
- JoinElimination.cs
- SqlTransaction.cs
- WebContentFormatHelper.cs
- SetStoryboardSpeedRatio.cs
- CharacterMetricsDictionary.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- CanExecuteRoutedEventArgs.cs
- XmlStringTable.cs
- IncrementalReadDecoders.cs
- DataControlField.cs
- HostingPreferredMapPath.cs
- EventLogEntry.cs
- WebScriptMetadataMessage.cs
- TextParagraphProperties.cs
- PreviewPageInfo.cs
- OdbcEnvironmentHandle.cs
- ListViewInsertedEventArgs.cs
- UIElementIsland.cs
- PrintingPermissionAttribute.cs
- PageParser.cs
- DataGridViewCellFormattingEventArgs.cs
- QilStrConcatenator.cs
- RelationshipDetailsCollection.cs
- _LocalDataStore.cs
- LocationUpdates.cs
- FixUpCollection.cs
- Rethrow.cs
- XmlParserContext.cs
- DataSpaceManager.cs
- NameValueFileSectionHandler.cs
- RelationshipConstraintValidator.cs
- AsyncParams.cs
- CodeDomConfigurationHandler.cs
- DocumentViewerHelper.cs
- TemplateKeyConverter.cs
- OperatingSystem.cs
- FixedStringLookup.cs
- TextShapeableCharacters.cs
- PersonalizationStateInfoCollection.cs
- ScrollData.cs
- OpCopier.cs
- SystemInfo.cs
- InstanceDataCollectionCollection.cs
- Accessible.cs
- CircleHotSpot.cs
- BuildManager.cs
- DataGridAddNewRow.cs
- DataGridViewTopRowAccessibleObject.cs
- LocalizationComments.cs
- SQLGuid.cs
- StaticFileHandler.cs
- __Filters.cs
- PointCollectionValueSerializer.cs
- PersonalizationProviderCollection.cs
- ReachSerializationCacheItems.cs
- DataTableNewRowEvent.cs
- ParenthesizePropertyNameAttribute.cs
- Activator.cs
- EnvironmentPermission.cs
- VirtualPathUtility.cs
- IFlowDocumentViewer.cs
- ContextItem.cs
- OleDbError.cs
- OdbcHandle.cs
- WebSysDescriptionAttribute.cs
- XsdDateTime.cs
- BaseDataListComponentEditor.cs
- ProxyGenerator.cs
- SemanticKeyElement.cs
- XPathNodeHelper.cs
- FilterElement.cs
- _AutoWebProxyScriptHelper.cs
- MsmqIntegrationInputChannel.cs
- ExpressionParser.cs
- EventProviderBase.cs
- DataGridViewLinkCell.cs
- CryptoConfig.cs
- CapabilitiesUse.cs
- ControlType.cs
- UpdatePanel.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- SqlBulkCopyColumnMapping.cs
- sortedlist.cs
- DocumentSchemaValidator.cs
- XmlCDATASection.cs
- Message.cs
- RectAnimationClockResource.cs
- TimeSpanMinutesConverter.cs
- IImplicitResourceProvider.cs
- PointAnimationUsingKeyFrames.cs