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
- CreateUserWizard.cs
- GlobalizationSection.cs
- Popup.cs
- ValueTable.cs
- PathFigure.cs
- ThreadSafeList.cs
- ChangeProcessor.cs
- PagesSection.cs
- ChangeNode.cs
- FontFamily.cs
- CloudCollection.cs
- ClrProviderManifest.cs
- LinkDesigner.cs
- CroppedBitmap.cs
- ServiceControllerDesigner.cs
- DispatcherHooks.cs
- ObfuscationAttribute.cs
- Journal.cs
- LinqDataSourceContextEventArgs.cs
- PackageRelationshipSelector.cs
- Line.cs
- SessionEndedEventArgs.cs
- TransformDescriptor.cs
- XmlRootAttribute.cs
- TypedTableBaseExtensions.cs
- ImageField.cs
- OrthographicCamera.cs
- LocalizableAttribute.cs
- XmlWriterSettings.cs
- RuntimeArgumentHandle.cs
- HttpCachePolicyElement.cs
- TraceLevelStore.cs
- HebrewCalendar.cs
- ProfileProvider.cs
- ClientSettingsProvider.cs
- BaseProcessProtocolHandler.cs
- ZipIOBlockManager.cs
- ToolStripScrollButton.cs
- QilNode.cs
- InvokeMemberBinder.cs
- EntityCommand.cs
- SqlInternalConnectionTds.cs
- HtmlHistory.cs
- EntityCollection.cs
- ToolStripDesignerAvailabilityAttribute.cs
- MediaElement.cs
- ToolZone.cs
- WebEncodingValidatorAttribute.cs
- HealthMonitoringSection.cs
- SQLByte.cs
- MenuEventArgs.cs
- Decimal.cs
- WinFormsUtils.cs
- ScaleTransform3D.cs
- BitmapPalette.cs
- DecimalAverageAggregationOperator.cs
- GlobalizationSection.cs
- ReferentialConstraint.cs
- EventLogInformation.cs
- Model3DGroup.cs
- Rect3D.cs
- CodeNamespaceCollection.cs
- FileDialog.cs
- UdpMessageProperty.cs
- SqlBuilder.cs
- OdbcErrorCollection.cs
- ImmutableCollection.cs
- VirtualPathUtility.cs
- NetMsmqBindingCollectionElement.cs
- DataKeyCollection.cs
- XamlClipboardData.cs
- FileLevelControlBuilderAttribute.cs
- CommandField.cs
- DynamicQueryableWrapper.cs
- MetadataUtilsSmi.cs
- OptimalBreakSession.cs
- BinHexEncoder.cs
- GridViewColumnCollection.cs
- ViewPort3D.cs
- SpotLight.cs
- GridViewUpdateEventArgs.cs
- AffineTransform3D.cs
- SafeProcessHandle.cs
- SecureConversationDriver.cs
- ThrowHelper.cs
- AutoGeneratedField.cs
- cookiecontainer.cs
- NameObjectCollectionBase.cs
- Rect3D.cs
- InvalidAsynchronousStateException.cs
- SqlRetyper.cs
- PaginationProgressEventArgs.cs
- DependencyObject.cs
- InvalidPrinterException.cs
- GeneralTransform2DTo3DTo2D.cs
- StateMachineHelpers.cs
- SqlTransaction.cs
- RegisteredScript.cs
- SqlDataSourceSelectingEventArgs.cs
- QueryTreeBuilder.cs