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
- QuarticEase.cs
- TextEffect.cs
- CharacterHit.cs
- TextSearch.cs
- BindMarkupExtensionSerializer.cs
- HttpClientCertificate.cs
- JapaneseCalendar.cs
- CompositeDataBoundControl.cs
- CodeMemberMethod.cs
- ConsoleCancelEventArgs.cs
- AutoCompleteStringCollection.cs
- IsolatedStorageFile.cs
- TabPanel.cs
- UpdatableGenericsFeature.cs
- AlignmentYValidation.cs
- HttpWriter.cs
- ProcessStartInfo.cs
- PrinterResolution.cs
- ScrollProviderWrapper.cs
- HighContrastHelper.cs
- WebServiceHostFactory.cs
- DelayedRegex.cs
- KerberosRequestorSecurityToken.cs
- DataGridViewComboBoxEditingControl.cs
- ModelTreeEnumerator.cs
- UInt16.cs
- HttpCacheParams.cs
- ResourceDictionary.cs
- XmlDataCollection.cs
- StorageEntitySetMapping.cs
- DbSource.cs
- DependencyObjectProvider.cs
- FixedDSBuilder.cs
- OleDbDataReader.cs
- JoinTreeNode.cs
- messageonlyhwndwrapper.cs
- PasswordPropertyTextAttribute.cs
- JoinSymbol.cs
- PLINQETWProvider.cs
- FormViewUpdatedEventArgs.cs
- CatalogPartChrome.cs
- Debugger.cs
- XPathBuilder.cs
- RowBinding.cs
- XmlSchemaObjectCollection.cs
- AllMembershipCondition.cs
- ToolBarDesigner.cs
- SizeAnimationBase.cs
- CheckPair.cs
- DispatcherHookEventArgs.cs
- rsa.cs
- DelayLoadType.cs
- EdmComplexPropertyAttribute.cs
- DbCommandDefinition.cs
- CodeExpressionStatement.cs
- Stacktrace.cs
- PageResolution.cs
- DESCryptoServiceProvider.cs
- GeneratedCodeAttribute.cs
- DownloadProgressEventArgs.cs
- LookupBindingPropertiesAttribute.cs
- EventHandlersStore.cs
- DebugInfoGenerator.cs
- UnsafeNativeMethods.cs
- WebPartsPersonalizationAuthorization.cs
- AutomationFocusChangedEventArgs.cs
- XmlTextAttribute.cs
- LinearQuaternionKeyFrame.cs
- CatalogZoneBase.cs
- PresentationAppDomainManager.cs
- ValueTable.cs
- SHA256CryptoServiceProvider.cs
- XmlIlTypeHelper.cs
- NamespaceCollection.cs
- DelayLoadType.cs
- SimpleType.cs
- SemanticAnalyzer.cs
- updateconfighost.cs
- _TimerThread.cs
- MaskedTextBox.cs
- SolidColorBrush.cs
- TrackingRecordPreFilter.cs
- EntityCollection.cs
- ScriptingJsonSerializationSection.cs
- Button.cs
- SqlFunctionAttribute.cs
- ServiceBuildProvider.cs
- ComponentTray.cs
- Symbol.cs
- QilInvoke.cs
- WindowsClaimSet.cs
- DataGridHeaderBorder.cs
- DeriveBytes.cs
- TrackBar.cs
- NullableLongSumAggregationOperator.cs
- XmlEnumAttribute.cs
- XmlSchemaAttributeGroupRef.cs
- ScrollPatternIdentifiers.cs
- Header.cs
- StylusDownEventArgs.cs