Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- StorageInfo.cs
- StringFreezingAttribute.cs
- PrintPageEvent.cs
- DataBindingsDialog.cs
- SectionInput.cs
- XPathNodeHelper.cs
- Int16Storage.cs
- SinglePageViewer.cs
- CopyCodeAction.cs
- RegisteredExpandoAttribute.cs
- TrailingSpaceComparer.cs
- DesignerUtility.cs
- GridViewDeleteEventArgs.cs
- IdentityNotMappedException.cs
- KeySpline.cs
- ResourcePermissionBase.cs
- ToolStripDropDown.cs
- DataGridViewColumnTypeEditor.cs
- TextEditorTyping.cs
- QilChoice.cs
- TextParagraphView.cs
- HwndProxyElementProvider.cs
- GroupBox.cs
- SoapSchemaExporter.cs
- DispatcherExceptionFilterEventArgs.cs
- PropertyRef.cs
- TextSelection.cs
- ZipFileInfoCollection.cs
- ModuleBuilder.cs
- Point4D.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- WindowsSolidBrush.cs
- NamespaceEmitter.cs
- StylusButtonEventArgs.cs
- X509Certificate.cs
- MultitargetUtil.cs
- RadioButtonFlatAdapter.cs
- DoubleAnimationClockResource.cs
- oledbconnectionstring.cs
- GridItemPattern.cs
- ModelPropertyImpl.cs
- HtmlInputSubmit.cs
- mactripleDES.cs
- NonceCache.cs
- SingleTagSectionHandler.cs
- DataGridItemEventArgs.cs
- SiteMap.cs
- SourceFileInfo.cs
- EntitySqlQueryCacheEntry.cs
- ModuleBuilderData.cs
- ListenerElementsCollection.cs
- ResourceReferenceKeyNotFoundException.cs
- InternalControlCollection.cs
- ApplicationSecurityManager.cs
- ListBox.cs
- UriParserTemplates.cs
- WmfPlaceableFileHeader.cs
- fixedPageContentExtractor.cs
- SubstitutionList.cs
- XPathItem.cs
- ProcessRequestArgs.cs
- HttpDebugHandler.cs
- XmlSchemaChoice.cs
- TransformerConfigurationWizardBase.cs
- Grid.cs
- WebReferencesBuildProvider.cs
- SqlInternalConnection.cs
- FacetDescriptionElement.cs
- MinimizableAttributeTypeConverter.cs
- RegexRunnerFactory.cs
- CompilerError.cs
- XmlAttributeCache.cs
- ColumnCollection.cs
- ButtonFieldBase.cs
- PaperSize.cs
- DocumentSequenceHighlightLayer.cs
- ProfileInfo.cs
- NamedObject.cs
- PriorityQueue.cs
- StylusPointCollection.cs
- ReadOnlyObservableCollection.cs
- DataReaderContainer.cs
- OracleTimeSpan.cs
- DataViewSettingCollection.cs
- TreeViewDesigner.cs
- SectionInformation.cs
- InstanceDataCollectionCollection.cs
- LicenseProviderAttribute.cs
- Metadata.cs
- BlurBitmapEffect.cs
- InvalidComObjectException.cs
- TreeView.cs
- OdbcDataAdapter.cs
- ColumnClickEvent.cs
- _AutoWebProxyScriptWrapper.cs
- FrameworkContextData.cs
- ToolStripPanelRow.cs
- RouteItem.cs
- XmlSchemaExporter.cs