Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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 } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OleDbDataReader.cs
- StylusPointPropertyInfoDefaults.cs
- ByteConverter.cs
- DoubleAnimationClockResource.cs
- SoapFault.cs
- UserControlAutomationPeer.cs
- DESCryptoServiceProvider.cs
- NativeMethods.cs
- PowerModeChangedEventArgs.cs
- DocumentSchemaValidator.cs
- InternalConfigSettingsFactory.cs
- InfoCardHelper.cs
- ActiveDocumentEvent.cs
- ViewSimplifier.cs
- OdbcReferenceCollection.cs
- WebColorConverter.cs
- HwndPanningFeedback.cs
- SQLByte.cs
- CopyNodeSetAction.cs
- DataGridItemAutomationPeer.cs
- ZoomPercentageConverter.cs
- MatrixTransform3D.cs
- TreeView.cs
- ConversionContext.cs
- OLEDB_Util.cs
- ComponentChangedEvent.cs
- HotSpotCollection.cs
- FilterEventArgs.cs
- AsymmetricSignatureFormatter.cs
- CaseInsensitiveHashCodeProvider.cs
- ExplicitDiscriminatorMap.cs
- OleDbError.cs
- ListView.cs
- BamlTreeNode.cs
- ListViewSortEventArgs.cs
- CurrentChangedEventManager.cs
- ListViewContainer.cs
- SynchronizationLockException.cs
- SqlCommandSet.cs
- UnionQueryOperator.cs
- WhitespaceRuleReader.cs
- HttpProcessUtility.cs
- FrameworkPropertyMetadata.cs
- DefaultTextStoreTextComposition.cs
- DataGrid.cs
- EUCJPEncoding.cs
- XmlAttributeProperties.cs
- HttpResponseHeader.cs
- HtmlHistory.cs
- Size3D.cs
- CfgParser.cs
- GenerateTemporaryTargetAssembly.cs
- XmlDesignerDataSourceView.cs
- NetworkStream.cs
- ZipIOExtraField.cs
- SqlGatherConsumedAliases.cs
- PropertyMapper.cs
- JournalEntryListConverter.cs
- RangeContentEnumerator.cs
- SQLMembershipProvider.cs
- SchemaImporter.cs
- WorkflowRuntimeServicesBehavior.cs
- SqlDataSourceConfigureSortForm.cs
- FaultConverter.cs
- Calendar.cs
- SettingsContext.cs
- ObjectTypeMapping.cs
- MenuRenderer.cs
- ForEachAction.cs
- TypeBuilder.cs
- ImportContext.cs
- TreeIterator.cs
- WebPartMinimizeVerb.cs
- ColorAnimationBase.cs
- DurableInstanceProvider.cs
- Attributes.cs
- HandlerFactoryWrapper.cs
- InvalidOperationException.cs
- AppDomainManager.cs
- PnrpPeerResolver.cs
- ConcurrencyBehavior.cs
- CustomAttributeFormatException.cs
- ValueTable.cs
- SecurityTokenParametersEnumerable.cs
- PrinterResolution.cs
- hresults.cs
- ByteKeyFrameCollection.cs
- SQLInt64Storage.cs
- DoubleAnimationUsingKeyFrames.cs
- URLBuilder.cs
- regiisutil.cs
- SendMessageRecord.cs
- Graphics.cs
- COM2TypeInfoProcessor.cs
- AttributedMetaModel.cs
- XDRSchema.cs
- XsdValidatingReader.cs
- SpecularMaterial.cs
- AdapterUtil.cs
- ModelEditingScope.cs