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
- PolicyUnit.cs
- XPathBinder.cs
- ReadonlyMessageFilter.cs
- dbenumerator.cs
- WhileDesigner.cs
- ProcessHostMapPath.cs
- XpsResourceDictionary.cs
- DBPropSet.cs
- XPathExpr.cs
- OlePropertyStructs.cs
- PublisherIdentityPermission.cs
- UIAgentCrashedException.cs
- MatrixTransform3D.cs
- QilInvokeEarlyBound.cs
- Int64AnimationBase.cs
- GeometryDrawing.cs
- documentsequencetextpointer.cs
- ObjectDataSourceSelectingEventArgs.cs
- SQLMoney.cs
- Brush.cs
- GenericUriParser.cs
- IsolatedStorageFilePermission.cs
- DataBindingCollection.cs
- Collection.cs
- DataObjectAttribute.cs
- AppearanceEditorPart.cs
- WindowsBrush.cs
- XmlValidatingReaderImpl.cs
- DataTable.cs
- TemplatePropertyEntry.cs
- ObjectItemNoOpAssemblyLoader.cs
- Simplifier.cs
- LinearGradientBrush.cs
- StickyNote.cs
- CodeDirectiveCollection.cs
- ReadOnlyTernaryTree.cs
- CodeArrayCreateExpression.cs
- RootBrowserWindowProxy.cs
- XmlSchemaObjectTable.cs
- SessionStateItemCollection.cs
- CopyNamespacesAction.cs
- MetadataPropertyvalue.cs
- IgnoreFileBuildProvider.cs
- ReadonlyMessageFilter.cs
- Event.cs
- PolicyImporterElement.cs
- XPathNodeIterator.cs
- XmlSchema.cs
- ClientTargetSection.cs
- FactoryRecord.cs
- XmlChildNodes.cs
- TextPointerBase.cs
- HttpValueCollection.cs
- PhysicalAddress.cs
- DoubleAnimationUsingPath.cs
- StylusButtonEventArgs.cs
- BitmapEffectDrawing.cs
- ProtocolElementCollection.cs
- GetTokenRequest.cs
- ObjectStorage.cs
- NoneExcludedImageIndexConverter.cs
- LayoutDump.cs
- DataGridCellInfo.cs
- CorrelationManager.cs
- TimeSpan.cs
- SystemInformation.cs
- ToolStripDropTargetManager.cs
- mda.cs
- TransformGroup.cs
- CodeCatchClause.cs
- SmtpFailedRecipientsException.cs
- LogRestartAreaEnumerator.cs
- IDQuery.cs
- Rfc4050KeyFormatter.cs
- filewebresponse.cs
- ViewStateModeByIdAttribute.cs
- TraceContextEventArgs.cs
- FixUpCollection.cs
- DoWorkEventArgs.cs
- Schema.cs
- SelectionItemProviderWrapper.cs
- SerializationException.cs
- BrowserCapabilitiesCodeGenerator.cs
- ProcessInfo.cs
- SecurityContextSecurityTokenResolver.cs
- SchemaSetCompiler.cs
- ComplexPropertyEntry.cs
- BitmapEffectvisualstate.cs
- AuthenticatingEventArgs.cs
- EditorZoneAutoFormat.cs
- PointKeyFrameCollection.cs
- SingleConverter.cs
- HitTestParameters.cs
- DockProviderWrapper.cs
- DateRangeEvent.cs
- PageAdapter.cs
- GridEntry.cs
- IEnumerable.cs
- TableLayoutSettingsTypeConverter.cs
- RelativeSource.cs