Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / HttpAsyncResult.cs / 4 / 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. // //----------------------------------------------------------------------------- /* * 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GraphicsPath.cs
- GroupPartitionExpr.cs
- RewritingSimplifier.cs
- FillErrorEventArgs.cs
- XmlPropertyBag.cs
- SimpleFieldTemplateFactory.cs
- GenericEnumConverter.cs
- DragEvent.cs
- HtmlTableRowCollection.cs
- BindingContext.cs
- CheckBox.cs
- BamlLocalizabilityResolver.cs
- XmlSchemaInferenceException.cs
- InProcStateClientManager.cs
- ExpressionBuilderCollection.cs
- OracleFactory.cs
- DashStyle.cs
- WindowsImpersonationContext.cs
- mongolianshape.cs
- OperationAbortedException.cs
- TabletDeviceInfo.cs
- SerializationStore.cs
- MultiTrigger.cs
- ElementNotEnabledException.cs
- XhtmlBasicTextViewAdapter.cs
- PeerNodeTraceRecord.cs
- SelectionManager.cs
- SimpleApplicationHost.cs
- ObjectDataSourceFilteringEventArgs.cs
- AuthenticationServiceManager.cs
- IntellisenseTextBox.designer.cs
- DispatchChannelSink.cs
- TrackingParameters.cs
- AutomationEvent.cs
- PageRanges.cs
- TableAdapterManagerHelper.cs
- Slider.cs
- DataSourceDescriptorCollection.cs
- LiteralText.cs
- Attributes.cs
- MetadataItem_Static.cs
- WebEventTraceProvider.cs
- ErrorFormatterPage.cs
- InternalRelationshipCollection.cs
- ChannelBinding.cs
- GlyphingCache.cs
- ResourceManager.cs
- CreateUserWizardStep.cs
- PersonalizationStateInfo.cs
- EdmRelationshipRoleAttribute.cs
- SessionEndingCancelEventArgs.cs
- WindowsSecurityToken.cs
- BufferedGraphics.cs
- Misc.cs
- CryptoApi.cs
- AudioBase.cs
- SqlRowUpdatedEvent.cs
- PropertyChangingEventArgs.cs
- BlockingCollection.cs
- DataGridSortingEventArgs.cs
- HwndKeyboardInputProvider.cs
- SqlInternalConnectionSmi.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- HostedAspNetEnvironment.cs
- TextRunCacheImp.cs
- XmlWhitespace.cs
- WebSysDescriptionAttribute.cs
- CharAnimationUsingKeyFrames.cs
- QilTernary.cs
- CachedPathData.cs
- returneventsaver.cs
- HttpSocketManager.cs
- SmiRequestExecutor.cs
- AddInActivator.cs
- InternalConfigEventArgs.cs
- ErrorHandlerModule.cs
- PolyQuadraticBezierSegment.cs
- RegisteredHiddenField.cs
- HashJoinQueryOperatorEnumerator.cs
- SmiGettersStream.cs
- FirstQueryOperator.cs
- SelectionWordBreaker.cs
- XmlnsCompatibleWithAttribute.cs
- basemetadatamappingvisitor.cs
- _emptywebproxy.cs
- XmlFormatWriterGenerator.cs
- MailMessage.cs
- VideoDrawing.cs
- FilteredSchemaElementLookUpTable.cs
- GridViewRowPresenterBase.cs
- SamlAssertionKeyIdentifierClause.cs
- PropertyValueChangedEvent.cs
- ConnectionPoolManager.cs
- Error.cs
- handlecollector.cs
- Helper.cs
- ZipIORawDataFileBlock.cs
- DmlSqlGenerator.cs
- MappingMetadataHelper.cs
- IDQuery.cs