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
- GroupDescription.cs
- EventDescriptorCollection.cs
- InheritanceAttribute.cs
- DataControlField.cs
- Ref.cs
- Serializer.cs
- LogReservationCollection.cs
- CustomError.cs
- StatusBarPanelClickEvent.cs
- CreateCardRequest.cs
- WindowsListView.cs
- GridViewItemAutomationPeer.cs
- ProfileSection.cs
- EntityKey.cs
- VarInfo.cs
- DataGridViewTopLeftHeaderCell.cs
- Typeface.cs
- Operator.cs
- BitmapEffectState.cs
- BadImageFormatException.cs
- IDictionary.cs
- CodeIterationStatement.cs
- SqlConnectionStringBuilder.cs
- WindowShowOrOpenTracker.cs
- GlobalItem.cs
- SchemaSetCompiler.cs
- ConfigurationManagerInternal.cs
- WebPartDeleteVerb.cs
- Visual3D.cs
- BaseCollection.cs
- SafeNativeMemoryHandle.cs
- TextDecorationUnitValidation.cs
- FunctionCommandText.cs
- PointCollection.cs
- DefaultValueAttribute.cs
- ProcessModelSection.cs
- XNameTypeConverter.cs
- EditorResources.cs
- HttpListenerTimeoutManager.cs
- BindingCollectionElement.cs
- SqlInternalConnectionSmi.cs
- ServiceModelConfigurationSection.cs
- Utils.cs
- UDPClient.cs
- TypeDelegator.cs
- Rule.cs
- ConsumerConnectionPoint.cs
- UserValidatedEventArgs.cs
- AnnotationStore.cs
- PresentationSource.cs
- RuntimeArgumentHandle.cs
- WindowsListViewSubItem.cs
- CodeAttributeDeclarationCollection.cs
- AutoGeneratedField.cs
- CacheMemory.cs
- Peer.cs
- TableColumnCollectionInternal.cs
- DirectoryNotFoundException.cs
- SafeFindHandle.cs
- OleServicesContext.cs
- ClassDataContract.cs
- EDesignUtil.cs
- CalendarDesigner.cs
- SelectorAutomationPeer.cs
- WindowShowOrOpenTracker.cs
- FtpCachePolicyElement.cs
- DocumentApplicationJournalEntry.cs
- KeyValueConfigurationElement.cs
- ServiceReference.cs
- TemplateInstanceAttribute.cs
- UiaCoreProviderApi.cs
- SrgsElementFactory.cs
- ContextStaticAttribute.cs
- SqlDataSource.cs
- MetadataItemEmitter.cs
- prefixendpointaddressmessagefilter.cs
- BaseParaClient.cs
- SizeAnimation.cs
- UpdatePanelControlTrigger.cs
- SQLDecimal.cs
- RichTextBox.cs
- TabItemAutomationPeer.cs
- PerformanceCounterManager.cs
- LazyInitializer.cs
- PixelFormatConverter.cs
- LocalBuilder.cs
- SchemaAttDef.cs
- BinaryMessageEncoder.cs
- Receive.cs
- LinkClickEvent.cs
- DispatcherExceptionEventArgs.cs
- CookieHandler.cs
- PrintControllerWithStatusDialog.cs
- LinkedResourceCollection.cs
- _NestedMultipleAsyncResult.cs
- ConfigurationPermission.cs
- wmiprovider.cs
- SerializableAttribute.cs
- DocumentViewerHelper.cs
- ObjectParameter.cs