Code:
/ FX-1434 / FX-1434 / 1.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
- SmtpException.cs
- PartialCachingAttribute.cs
- PlainXmlSerializer.cs
- updatecommandorderer.cs
- LedgerEntry.cs
- TimelineClockCollection.cs
- DataTemplate.cs
- NetMsmqBindingCollectionElement.cs
- BaseDataBoundControlDesigner.cs
- MarkupExtensionParser.cs
- OpenTypeLayoutCache.cs
- OpenTypeLayout.cs
- RightsManagementEncryptedStream.cs
- VisualStyleTypesAndProperties.cs
- EntityCollection.cs
- ActionFrame.cs
- _SSPISessionCache.cs
- KeyValuePairs.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- ClickablePoint.cs
- NamespaceList.cs
- DirectionalLight.cs
- SchemaComplexType.cs
- ItemAutomationPeer.cs
- DataGridCellEditEndingEventArgs.cs
- ListViewAutomationPeer.cs
- NgenServicingAttributes.cs
- XmlEventCache.cs
- TaiwanLunisolarCalendar.cs
- AdRotator.cs
- X509Certificate.cs
- cache.cs
- DrawingVisualDrawingContext.cs
- ProxyManager.cs
- jithelpers.cs
- VisualStyleInformation.cs
- TextViewSelectionProcessor.cs
- CharUnicodeInfo.cs
- NetworkStream.cs
- JpegBitmapDecoder.cs
- DataFormats.cs
- Point3DCollection.cs
- AutoGeneratedField.cs
- SocketInformation.cs
- OuterGlowBitmapEffect.cs
- BindingCompleteEventArgs.cs
- AssociationType.cs
- GrammarBuilderDictation.cs
- SpeakInfo.cs
- NestedContainer.cs
- Matrix.cs
- ContainerParagraph.cs
- WindowsListViewGroupHelper.cs
- PropertyGrid.cs
- ResizeBehavior.cs
- _NetworkingPerfCounters.cs
- AccessControlList.cs
- Solver.cs
- QilVisitor.cs
- SQLResource.cs
- LinkArea.cs
- BinaryObjectInfo.cs
- IPAddressCollection.cs
- ellipse.cs
- HitTestResult.cs
- FacetValues.cs
- AsymmetricSignatureFormatter.cs
- SystemGatewayIPAddressInformation.cs
- XsltInput.cs
- ColorInterpolationModeValidation.cs
- RightsManagementSuppressedStream.cs
- Pool.cs
- __Error.cs
- NavigationEventArgs.cs
- DesignerSerializationVisibilityAttribute.cs
- thaishape.cs
- DataGridColumnHeaderAutomationPeer.cs
- SchemaTableOptionalColumn.cs
- SafeRightsManagementHandle.cs
- MetadataCacheItem.cs
- TdsValueSetter.cs
- ListBindingConverter.cs
- StaticContext.cs
- HtmlElement.cs
- BaseCodePageEncoding.cs
- NativeMethods.cs
- SqlClientFactory.cs
- UserControlAutomationPeer.cs
- SmiRecordBuffer.cs
- MdiWindowListItemConverter.cs
- WpfXamlType.cs
- ActivityStateQuery.cs
- XmlSchemaAttributeGroup.cs
- ConfigDefinitionUpdates.cs
- GenericPrincipal.cs
- SourceFileBuildProvider.cs
- ClientOptions.cs
- XpsDocumentEvent.cs
- ToolStripDropDownItem.cs
- FileVersionInfo.cs