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
- ControlCollection.cs
- BitStack.cs
- RIPEMD160.cs
- TraceUtility.cs
- DiagnosticEventProvider.cs
- EntityKey.cs
- FormViewModeEventArgs.cs
- Label.cs
- NameObjectCollectionBase.cs
- FunctionOverloadResolver.cs
- PerspectiveCamera.cs
- BamlBinaryWriter.cs
- RequestCacheEntry.cs
- Metafile.cs
- WsdlBuildProvider.cs
- Calendar.cs
- DataBoundControlHelper.cs
- EdgeProfileValidation.cs
- OleStrCAMarshaler.cs
- Substitution.cs
- MemberHolder.cs
- MenuAdapter.cs
- Int32CollectionValueSerializer.cs
- SchemaCollectionPreprocessor.cs
- SerializationStore.cs
- TableRowCollection.cs
- SynchronizationContext.cs
- Operator.cs
- DataGrid.cs
- HierarchicalDataBoundControlAdapter.cs
- TextElementCollectionHelper.cs
- Condition.cs
- ToolStripPanel.cs
- XmlSchemaExporter.cs
- ThemeDictionaryExtension.cs
- BaseAppDomainProtocolHandler.cs
- AxDesigner.cs
- DrawingAttributeSerializer.cs
- ReadOnlyPropertyMetadata.cs
- TableLayoutStyle.cs
- CodeBlockBuilder.cs
- TextRange.cs
- SharedUtils.cs
- TextFormatterImp.cs
- DataGridRow.cs
- CrossContextChannel.cs
- GridViewRowPresenter.cs
- PolygonHotSpot.cs
- ElementMarkupObject.cs
- LiteralDesigner.cs
- SerialReceived.cs
- DataColumnChangeEvent.cs
- CommittableTransaction.cs
- WhitespaceRuleReader.cs
- DictionarySectionHandler.cs
- TdsParserStaticMethods.cs
- OdbcPermission.cs
- DataView.cs
- ObjectDataSourceChooseMethodsPanel.cs
- FullTextLine.cs
- EntityAdapter.cs
- TriggerAction.cs
- TrailingSpaceComparer.cs
- EtwTrace.cs
- SoundPlayer.cs
- GridItem.cs
- PaginationProgressEventArgs.cs
- BlurBitmapEffect.cs
- PolicyImporterElement.cs
- Type.cs
- Peer.cs
- Control.cs
- BlurEffect.cs
- AudioBase.cs
- CheckBox.cs
- ActivationArguments.cs
- TypePresenter.xaml.cs
- RemoteAsymmetricSignatureFormatter.cs
- SafeArchiveContext.cs
- ConstraintEnumerator.cs
- ConnectivityStatus.cs
- PropertyCollection.cs
- EncodingInfo.cs
- HttpInputStream.cs
- ErrorFormatterPage.cs
- OdbcParameter.cs
- C14NUtil.cs
- TagPrefixAttribute.cs
- DataGridViewLayoutData.cs
- ValueChangedEventManager.cs
- DbUpdateCommandTree.cs
- IssuanceLicense.cs
- HtmlTextArea.cs
- ListBase.cs
- SlipBehavior.cs
- LayoutTableCell.cs
- UpdatableWrapper.cs
- DeviceContexts.cs
- HttpRuntime.cs
- StringUtil.cs