Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / HttpAsyncResult.cs / 1305376 / 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
- DataTableNewRowEvent.cs
- CultureTableRecord.cs
- FragmentQuery.cs
- LOSFormatter.cs
- XmlSchemaImport.cs
- WsatProxy.cs
- Authorization.cs
- NonClientArea.cs
- SystemIcmpV4Statistics.cs
- BeginStoryboard.cs
- XappLauncher.cs
- CfgParser.cs
- ByteFacetDescriptionElement.cs
- DataGridColumn.cs
- ZipFileInfoCollection.cs
- StringArrayConverter.cs
- SimpleBitVector32.cs
- UniqueIdentifierService.cs
- SettingsBase.cs
- Matrix3DValueSerializer.cs
- ColorAnimation.cs
- DesignerForm.cs
- CompensateDesigner.cs
- TraceUtils.cs
- DesignerActionItem.cs
- NonValidatingSecurityTokenAuthenticator.cs
- DriveNotFoundException.cs
- DesignerAttribute.cs
- CompareInfo.cs
- ColorMatrix.cs
- arclist.cs
- DetailsViewDeleteEventArgs.cs
- BadImageFormatException.cs
- JapaneseCalendar.cs
- RegexBoyerMoore.cs
- ObjectDataSourceStatusEventArgs.cs
- AssemblyName.cs
- MetadataItemEmitter.cs
- DATA_BLOB.cs
- ResourcePart.cs
- AsymmetricAlgorithm.cs
- LineServicesRun.cs
- Events.cs
- EntityTypeBase.cs
- RectConverter.cs
- MenuItem.cs
- EventToken.cs
- RsaSecurityTokenAuthenticator.cs
- BaseComponentEditor.cs
- WebPageTraceListener.cs
- PassportAuthenticationEventArgs.cs
- FlagPanel.cs
- ThicknessConverter.cs
- DispatcherHooks.cs
- HyperLinkColumn.cs
- XPathExpr.cs
- ConfigurationCollectionAttribute.cs
- OpacityConverter.cs
- AnchoredBlock.cs
- Funcletizer.cs
- Expressions.cs
- NetTcpSecurityElement.cs
- IsolationInterop.cs
- SQLMoneyStorage.cs
- BeginStoryboard.cs
- ContainerTracking.cs
- TabItemWrapperAutomationPeer.cs
- DesignerSerializerAttribute.cs
- Pkcs7Signer.cs
- _PooledStream.cs
- DecoderFallback.cs
- DiagnosticsConfigurationHandler.cs
- XmlImplementation.cs
- ArgumentException.cs
- ParentControlDesigner.cs
- X509IssuerSerialKeyIdentifierClause.cs
- CompModSwitches.cs
- DataGridParentRows.cs
- TextBounds.cs
- RealizationDrawingContextWalker.cs
- BaseAsyncResult.cs
- StylusTip.cs
- Region.cs
- EncodingDataItem.cs
- SQlBooleanStorage.cs
- StreamGeometry.cs
- TextDecorationLocationValidation.cs
- NaturalLanguageHyphenator.cs
- LinqDataSourceSelectEventArgs.cs
- OutputCacheSettingsSection.cs
- TypefaceCollection.cs
- OdbcErrorCollection.cs
- ProjectionPruner.cs
- DesignerVerbToolStripMenuItem.cs
- FacetDescriptionElement.cs
- ViewPort3D.cs
- SchemaManager.cs
- NullableDecimalAverageAggregationOperator.cs
- FieldNameLookup.cs
- WebBrowserDocumentCompletedEventHandler.cs