Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / MultiAsyncResult.cs / 1305376 / 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
- DbConnectionPool.cs
- PointCollection.cs
- IsolatedStorageFile.cs
- IndexedString.cs
- DomainUpDown.cs
- TextSimpleMarkerProperties.cs
- SendingRequestEventArgs.cs
- EntityDesignerBuildProvider.cs
- TabPanel.cs
- PermissionSetEnumerator.cs
- ADConnectionHelper.cs
- FixedSOMTableCell.cs
- QilTargetType.cs
- UnsafeNativeMethods.cs
- PropertyIDSet.cs
- DataErrorValidationRule.cs
- DataBindEngine.cs
- PluralizationService.cs
- SQLBytes.cs
- SiteMapSection.cs
- MouseButton.cs
- FixedFindEngine.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- SimpleMailWebEventProvider.cs
- DashStyles.cs
- TabPage.cs
- SymmetricCryptoHandle.cs
- SHA256.cs
- XmlQualifiedNameTest.cs
- activationcontext.cs
- LightweightCodeGenerator.cs
- ProvidersHelper.cs
- EdmItemError.cs
- GroupStyle.cs
- _CacheStreams.cs
- TemplatingOptionsDialog.cs
- PropertyExpression.cs
- CollectionAdapters.cs
- StdValidatorsAndConverters.cs
- Knowncolors.cs
- StronglyTypedResourceBuilder.cs
- COM2PropertyPageUITypeConverter.cs
- HttpChannelFactory.cs
- MatrixTransform.cs
- SimpleHandlerFactory.cs
- COAUTHINFO.cs
- Context.cs
- FrameworkElement.cs
- CodeTypeReferenceCollection.cs
- MenuItemCollectionEditorDialog.cs
- RemotingServices.cs
- SrgsElementList.cs
- WSSecurityPolicy.cs
- ApplicationSecurityInfo.cs
- StylusShape.cs
- InternalBufferOverflowException.cs
- LinqTreeNodeEvaluator.cs
- _LocalDataStore.cs
- SendReply.cs
- ConfigurationManagerInternal.cs
- XsltConvert.cs
- ProviderSettingsCollection.cs
- RawStylusSystemGestureInputReport.cs
- SetIterators.cs
- SystemColors.cs
- WindowPattern.cs
- ControlType.cs
- AssemblyUtil.cs
- ArglessEventHandlerProxy.cs
- GradientBrush.cs
- ToolConsole.cs
- OrthographicCamera.cs
- XmlSchemaGroupRef.cs
- XmlText.cs
- TemplateControlCodeDomTreeGenerator.cs
- SerializationHelper.cs
- RenderCapability.cs
- ErrorHandler.cs
- _MultipleConnectAsync.cs
- AxHost.cs
- DSASignatureFormatter.cs
- BindingExpressionUncommonField.cs
- CompareValidator.cs
- MultilineStringConverter.cs
- GlobalProxySelection.cs
- RSATokenProvider.cs
- OleDbErrorCollection.cs
- WebConfigurationFileMap.cs
- PartialTrustVisibleAssembly.cs
- ListItemCollection.cs
- RegistryConfigurationProvider.cs
- SimpleHandlerFactory.cs
- CodeDomExtensionMethods.cs
- XPathAncestorQuery.cs
- DEREncoding.cs
- DbParameterCollection.cs
- BrowsableAttribute.cs
- PolicyLevel.cs
- ToolStripPanelCell.cs
- XmlSchemaObjectCollection.cs