Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ObjectListFieldCollection.cs
- DynamicUpdateCommand.cs
- CodeAccessPermission.cs
- RunInstallerAttribute.cs
- SecurityKeyIdentifier.cs
- CustomValidator.cs
- ObjectIDGenerator.cs
- NamedObject.cs
- RegexNode.cs
- InputLanguage.cs
- CodeParameterDeclarationExpression.cs
- MultiPropertyDescriptorGridEntry.cs
- ConfigurationLocationCollection.cs
- sapiproxy.cs
- CompilerGeneratedAttribute.cs
- RectAnimationBase.cs
- PageWrapper.cs
- BitmapMetadata.cs
- AnnotationComponentChooser.cs
- PermissionSetTriple.cs
- Calendar.cs
- TextContainerChangedEventArgs.cs
- FileDialogPermission.cs
- AnimationLayer.cs
- AccessDataSourceView.cs
- DocumentEventArgs.cs
- SmtpFailedRecipientsException.cs
- RuleInfoComparer.cs
- TreeView.cs
- DataGridTable.cs
- ProfilePropertySettings.cs
- GeneratedCodeAttribute.cs
- HttpCacheParams.cs
- DataGridViewCellStyleConverter.cs
- LookupNode.cs
- HMACSHA256.cs
- RSAPKCS1SignatureDeformatter.cs
- DataServiceQueryOfT.cs
- RowBinding.cs
- ResourceDictionary.cs
- InputChannelBinder.cs
- ISO2022Encoding.cs
- GridItemPatternIdentifiers.cs
- DirectoryNotFoundException.cs
- RPIdentityRequirement.cs
- CollectionCodeDomSerializer.cs
- BoundColumn.cs
- OdbcException.cs
- DataPagerFieldItem.cs
- Matrix3D.cs
- Claim.cs
- VirtualPath.cs
- CngKeyCreationParameters.cs
- ToolboxItemAttribute.cs
- WebSysDisplayNameAttribute.cs
- NumberFormatter.cs
- GraphicsPathIterator.cs
- SecurityUtils.cs
- WrapPanel.cs
- AutoSizeToolBoxItem.cs
- PaperSize.cs
- MergeFilterQuery.cs
- CuspData.cs
- HttpException.cs
- Attachment.cs
- TextServicesProperty.cs
- Stylesheet.cs
- ConnectionsZone.cs
- TemplateModeChangedEventArgs.cs
- TreeNodeEventArgs.cs
- TdsParserSafeHandles.cs
- CqlParser.cs
- LoginView.cs
- XmlSchemaDatatype.cs
- AppDomainFactory.cs
- CorrelationService.cs
- XamlFilter.cs
- DataGridViewCellStyle.cs
- UidPropertyAttribute.cs
- RtfControls.cs
- EventRecord.cs
- util.cs
- FragmentNavigationEventArgs.cs
- EtwTrackingBehavior.cs
- DictionarySectionHandler.cs
- HiddenField.cs
- XmlTextEncoder.cs
- SelectionEditor.cs
- EventLogPermissionAttribute.cs
- ManipulationDeltaEventArgs.cs
- _ListenerAsyncResult.cs
- CommandHelper.cs
- _HeaderInfo.cs
- XmlReturnWriter.cs
- SetStoryboardSpeedRatio.cs
- SmiContextFactory.cs
- BoundColumn.cs
- DbSetClause.cs
- ObjectSpanRewriter.cs
- ProviderConnectionPointCollection.cs