Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / HttpAsyncResult.cs / 2 / HttpAsyncResult.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * ASP.NET simple internal implementation of IAsyncResult * * Copyright (c) 2000 Microsoft Corporation */ namespace System.Web { using System; using System.Threading; internal class HttpAsyncResult : IAsyncResult { private AsyncCallback _callback; private Object _asyncState; private bool _completed; private bool _completedSynchronously; private Object _result; private Exception _error; // pipeline support private RequestNotificationStatus _status; /* * Constructor with pending result */ internal HttpAsyncResult(AsyncCallback cb, Object state) { _callback = cb; _asyncState = state; _status = RequestNotificationStatus.Continue; } /* * Constructor with known result */ internal HttpAsyncResult(AsyncCallback cb, Object state, bool completed, Object result, Exception error) { _callback = cb; _asyncState = state; _completed = completed; _completedSynchronously = completed; _result = result; _error = error; _status = RequestNotificationStatus.Continue; if (_completed && _callback != null) _callback(this); } internal void SetComplete() { _completed = true; } /* * Helper method to process completions */ internal void Complete(bool synchronous, Object result, Exception error, RequestNotificationStatus status) { _completed = true; _completedSynchronously = synchronous; _result = result; _error = error; _status = status; if (_callback != null) _callback(this); } internal void Complete(bool synchronous, Object result, Exception error) { Complete(synchronous, result, error, RequestNotificationStatus.Continue); } /* * Helper method to implement End call to async method */ internal Object End() { if (_error != null) throw new HttpException(null, _error); return _result; } // // Properties that are not part of IAsyncResult // internal Exception Error { get { return _error;}} internal RequestNotificationStatus Status { get { return _status; } } // // IAsyncResult implementation // public bool IsCompleted { get { return _completed;}} public bool CompletedSynchronously { get { return _completedSynchronously;}} public Object AsyncState { get { return _asyncState;}} public WaitHandle AsyncWaitHandle { get { return null;}} // wait not supported } } // 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
- TrustManagerPromptUI.cs
- TrustManagerPromptUI.cs
- DeclarativeConditionsCollection.cs
- IPipelineRuntime.cs
- MailHeaderInfo.cs
- RowParagraph.cs
- MiniConstructorInfo.cs
- ContentHostHelper.cs
- LambdaCompiler.Unary.cs
- HtmlInputButton.cs
- CodeExporter.cs
- ListViewInsertedEventArgs.cs
- Number.cs
- Token.cs
- CorrelationManager.cs
- Decorator.cs
- HttpRawResponse.cs
- PackWebResponse.cs
- X509Chain.cs
- _ConnectionGroup.cs
- MsmqIntegrationSecurityMode.cs
- QuestionEventArgs.cs
- SmtpDateTime.cs
- ListSourceHelper.cs
- BindToObject.cs
- Frame.cs
- SiteMapDataSourceView.cs
- CfgParser.cs
- GeneralTransform3D.cs
- SyndicationSerializer.cs
- DataServices.cs
- DelegatedStream.cs
- IItemProperties.cs
- TdsParserStateObject.cs
- TableStyle.cs
- Vector3DKeyFrameCollection.cs
- NamespaceEmitter.cs
- CodeSnippetCompileUnit.cs
- SchemaTableOptionalColumn.cs
- StyleXamlParser.cs
- OperandQuery.cs
- cache.cs
- Certificate.cs
- TemplateContentLoader.cs
- Viewport3DAutomationPeer.cs
- EventHandlerService.cs
- ArgumentOutOfRangeException.cs
- TabControlEvent.cs
- SqlClientWrapperSmiStream.cs
- WmlCommandAdapter.cs
- StringUtil.cs
- PeerUnsafeNativeCryptMethods.cs
- wgx_render.cs
- UrlPropertyAttribute.cs
- EncoderFallback.cs
- QuotedPairReader.cs
- ScrollChrome.cs
- COM2TypeInfoProcessor.cs
- X509ScopedServiceCertificateElementCollection.cs
- IdentityManager.cs
- WebPartsSection.cs
- SystemWebCachingSectionGroup.cs
- ChineseLunisolarCalendar.cs
- XmlSchemaCollection.cs
- OrCondition.cs
- MeasureData.cs
- GenericsNotImplementedException.cs
- ByteAnimationBase.cs
- ForwardPositionQuery.cs
- BitStack.cs
- ListViewContainer.cs
- InternalPolicyElement.cs
- FrameDimension.cs
- CodeDOMProvider.cs
- SettingsSection.cs
- NameNode.cs
- TextEffect.cs
- SimpleType.cs
- ContractHandle.cs
- SpecularMaterial.cs
- OpenFileDialog.cs
- XmlWhitespace.cs
- SchemaAttDef.cs
- CatalogPartCollection.cs
- ProtocolImporter.cs
- BuiltInExpr.cs
- DataViewListener.cs
- VirtualPathProvider.cs
- NotifyCollectionChangedEventArgs.cs
- HtmlString.cs
- Authorization.cs
- UserControlAutomationPeer.cs
- ResourceKey.cs
- XmlSchema.cs
- OutputCacheSettings.cs
- PersistenceTypeAttribute.cs
- ActivationArguments.cs
- Multiply.cs
- PagesSection.cs
- ComPlusDiagnosticTraceSchemas.cs