Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- VSWCFServiceContractGenerator.cs
- CompModSwitches.cs
- XmlName.cs
- CngAlgorithmGroup.cs
- StateRuntime.cs
- FormsAuthenticationTicket.cs
- MimeMultiPart.cs
- SoapIncludeAttribute.cs
- SegmentInfo.cs
- ActiveDesignSurfaceEvent.cs
- SortQuery.cs
- ConfigXmlText.cs
- ValidationEventArgs.cs
- ChunkedMemoryStream.cs
- SystemIPGlobalProperties.cs
- CheckBoxDesigner.cs
- EntityDataSourceValidationException.cs
- XamlFilter.cs
- Vector.cs
- SymLanguageVendor.cs
- XslTransform.cs
- FieldNameLookup.cs
- UnsafeNativeMethodsTablet.cs
- StructuralObject.cs
- AddInSegmentDirectoryNotFoundException.cs
- ServiceModelConfigurationSectionGroup.cs
- Timer.cs
- MimeMultiPart.cs
- TextFormatterImp.cs
- TraceUtility.cs
- Binding.cs
- RawUIStateInputReport.cs
- ScriptingScriptResourceHandlerSection.cs
- precedingsibling.cs
- SecurityContextSecurityTokenResolver.cs
- BufferModesCollection.cs
- ParseNumbers.cs
- FontWeightConverter.cs
- DNS.cs
- TraceContext.cs
- CounterCreationDataCollection.cs
- MetafileHeaderWmf.cs
- FontUnitConverter.cs
- Model3DGroup.cs
- DataSourceView.cs
- UserNameSecurityTokenAuthenticator.cs
- SyntaxCheck.cs
- _CookieModule.cs
- ProfileSection.cs
- CompilerInfo.cs
- DbConnectionStringBuilder.cs
- SystemNetworkInterface.cs
- ToolTip.cs
- OleDbReferenceCollection.cs
- ClientTarget.cs
- OrderByQueryOptionExpression.cs
- ModelItemKeyValuePair.cs
- AutomationAttributeInfo.cs
- XamlPointCollectionSerializer.cs
- FrameworkName.cs
- ArrayElementGridEntry.cs
- ReflectEventDescriptor.cs
- ConfigurationProperty.cs
- FlowchartSizeFeature.cs
- BuildProvidersCompiler.cs
- ViewRendering.cs
- FileDialogPermission.cs
- WebColorConverter.cs
- XamlNamespaceHelper.cs
- Ops.cs
- NameSpaceExtractor.cs
- WebScriptMetadataFormatter.cs
- DomainUpDown.cs
- IsolatedStorageFileStream.cs
- ActivityInterfaces.cs
- PathSegment.cs
- GlyphingCache.cs
- DesignBinding.cs
- PropertyGroupDescription.cs
- EncodingNLS.cs
- CustomWebEventKey.cs
- PageFunction.cs
- TrustManagerPromptUI.cs
- ModelPerspective.cs
- _ProxyChain.cs
- XmlElementAttributes.cs
- UInt64Converter.cs
- SoapExtensionTypeElement.cs
- UrlPropertyAttribute.cs
- SignatureToken.cs
- ObjectListCommandCollection.cs
- CommandDesigner.cs
- UInt64Converter.cs
- ListBoxItemAutomationPeer.cs
- DependencyPropertyAttribute.cs
- ReferenceSchema.cs
- FileNotFoundException.cs
- ObjectSecurity.cs
- GridViewRowEventArgs.cs
- DocumentAutomationPeer.cs