Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Net / System / Net / Mail / MultiAsyncResult.cs / 1 / MultiAsyncResult.cs
namespace System.Net.Mime { using System; internal class MultiAsyncResult : LazyAsyncResult { int outstanding; object context; internal MultiAsyncResult(object context, AsyncCallback callback, object state) : base(context,state,callback) { this.context = context; } internal object Context { get { return this.context; } } internal void Enter() { Increment(); } internal void Leave() { Decrement(); } internal void Leave(object result) { this.Result = result; Decrement(); } void Decrement() { if (System.Threading.Interlocked.Decrement(ref this.outstanding) == -1) { base.InvokeCallback(Result); } } void Increment() { System.Threading.Interlocked.Increment(ref this.outstanding); } internal void CompleteSequence() { Decrement(); } internal static object End(IAsyncResult result) { MultiAsyncResult thisPtr = (MultiAsyncResult)result; thisPtr.InternalWaitForCompletion(); return thisPtr.Result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Net.Mime { using System; internal class MultiAsyncResult : LazyAsyncResult { int outstanding; object context; internal MultiAsyncResult(object context, AsyncCallback callback, object state) : base(context,state,callback) { this.context = context; } internal object Context { get { return this.context; } } internal void Enter() { Increment(); } internal void Leave() { Decrement(); } internal void Leave(object result) { this.Result = result; Decrement(); } void Decrement() { if (System.Threading.Interlocked.Decrement(ref this.outstanding) == -1) { base.InvokeCallback(Result); } } void Increment() { System.Threading.Interlocked.Increment(ref this.outstanding); } internal void CompleteSequence() { Decrement(); } internal static object End(IAsyncResult result) { MultiAsyncResult thisPtr = (MultiAsyncResult)result; thisPtr.InternalWaitForCompletion(); return thisPtr.Result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProxyHwnd.cs
- TreeViewItemAutomationPeer.cs
- SystemResourceHost.cs
- SafeNativeMethods.cs
- XmlNodeChangedEventArgs.cs
- ConnectionPoolManager.cs
- InheritanceUI.cs
- SecurityRuntime.cs
- PeerDuplexChannel.cs
- PersonalizationAdministration.cs
- HybridDictionary.cs
- EncoderNLS.cs
- CopyEncoder.cs
- XmlComplianceUtil.cs
- XsltException.cs
- ConstraintManager.cs
- ApplicationServiceManager.cs
- Win32KeyboardDevice.cs
- ClientConvert.cs
- AddInBase.cs
- TiffBitmapDecoder.cs
- WorkflowRuntimeEndpoint.cs
- NetworkAddressChange.cs
- brushes.cs
- EmbeddedMailObjectsCollection.cs
- DataServiceHost.cs
- TreeIterators.cs
- LabelDesigner.cs
- OdbcInfoMessageEvent.cs
- NetStream.cs
- SafeCryptContextHandle.cs
- TabletCollection.cs
- WindowsListViewScroll.cs
- RegexCapture.cs
- DataGridAddNewRow.cs
- DivideByZeroException.cs
- SafeHandle.cs
- TableLayoutPanel.cs
- BinaryObjectWriter.cs
- Pointer.cs
- FormDocumentDesigner.cs
- DrawListViewItemEventArgs.cs
- HyperlinkAutomationPeer.cs
- CompositeCollectionView.cs
- KeyConverter.cs
- TriggerActionCollection.cs
- KeyedCollection.cs
- FixedSOMLineCollection.cs
- ObjectHandle.cs
- baseshape.cs
- QueryCacheManager.cs
- ProxyHelper.cs
- DependencyObjectPropertyDescriptor.cs
- XmlDataDocument.cs
- FastEncoder.cs
- PersonalizationProvider.cs
- TableCell.cs
- DataMisalignedException.cs
- DataSourceGeneratorException.cs
- FontCollection.cs
- InvalidCastException.cs
- X509IssuerSerialKeyIdentifierClause.cs
- BrowserDefinition.cs
- Track.cs
- Binding.cs
- InputLangChangeEvent.cs
- ChangesetResponse.cs
- CellQuery.cs
- ListenerConstants.cs
- SocketConnection.cs
- InstanceLockLostException.cs
- LoginViewDesigner.cs
- WebSysDefaultValueAttribute.cs
- ApplicationContext.cs
- RemoteWebConfigurationHostServer.cs
- CellNormalizer.cs
- TypedServiceChannelBuilder.cs
- ClientEventManager.cs
- EncodingStreamWrapper.cs
- WinFormsComponentEditor.cs
- SoapAttributes.cs
- EventMappingSettingsCollection.cs
- AssemblyName.cs
- BamlTreeMap.cs
- DescriptionAttribute.cs
- IndexOutOfRangeException.cs
- FragmentNavigationEventArgs.cs
- ContextMarshalException.cs
- ParagraphVisual.cs
- HtmlElementErrorEventArgs.cs
- TextProviderWrapper.cs
- Version.cs
- CalendarBlackoutDatesCollection.cs
- TextSearch.cs
- LicFileLicenseProvider.cs
- FormViewAutoFormat.cs
- ResXBuildProvider.cs
- SizeFConverter.cs
- Win32.cs
- FormViewPageEventArgs.cs