Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / HttpAsyncResult.cs / 1 / 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
- XmlJsonReader.cs
- DynamicDataExtensions.cs
- EditorPartChrome.cs
- XsltQilFactory.cs
- PasswordDeriveBytes.cs
- DictionaryBase.cs
- ScriptResourceDefinition.cs
- BoundsDrawingContextWalker.cs
- RoleManagerSection.cs
- DriveNotFoundException.cs
- _KerberosClient.cs
- TableItemPattern.cs
- FocusWithinProperty.cs
- Panel.cs
- IncomingWebRequestContext.cs
- versioninfo.cs
- IdnMapping.cs
- PeerCollaborationPermission.cs
- QueryLifecycle.cs
- UnitySerializationHolder.cs
- XmlHelper.cs
- DataGridViewRowStateChangedEventArgs.cs
- DataFormat.cs
- PointHitTestParameters.cs
- WindowsPrincipal.cs
- sortedlist.cs
- InvalidPrinterException.cs
- WebPartActionVerb.cs
- ServiceNameElement.cs
- RegexWorker.cs
- DecimalMinMaxAggregationOperator.cs
- ToolStripPanel.cs
- XmlException.cs
- TreeBuilder.cs
- DataGridViewSelectedColumnCollection.cs
- DesignerForm.cs
- OdbcEnvironmentHandle.cs
- Wrapper.cs
- WebExceptionStatus.cs
- X509Certificate2.cs
- SqlNotificationEventArgs.cs
- TreeViewItem.cs
- DbProviderManifest.cs
- TemplateColumn.cs
- WindowsHyperlink.cs
- FirstQueryOperator.cs
- ProfilePropertySettings.cs
- ClientData.cs
- ByteStreamGeometryContext.cs
- ResourceDictionary.cs
- SByteStorage.cs
- AdapterDictionary.cs
- PointAnimationClockResource.cs
- EntityDataSourceDataSelectionPanel.cs
- DataGridViewIntLinkedList.cs
- SelectionPattern.cs
- ListBoxAutomationPeer.cs
- AssociationTypeEmitter.cs
- InternalRelationshipCollection.cs
- ColumnWidthChangingEvent.cs
- DetailsViewInsertedEventArgs.cs
- QilSortKey.cs
- UrlMappingCollection.cs
- CredentialCache.cs
- Substitution.cs
- BinaryMessageFormatter.cs
- LocalizableAttribute.cs
- ToolStripPanelRow.cs
- ToolZone.cs
- ListViewDesigner.cs
- DependencyObjectType.cs
- TranslateTransform3D.cs
- NavigationProperty.cs
- LocatorPartList.cs
- UserControlCodeDomTreeGenerator.cs
- HttpServerVarsCollection.cs
- OleDbRowUpdatedEvent.cs
- WebBrowserDocumentCompletedEventHandler.cs
- SharedUtils.cs
- DocumentOrderComparer.cs
- MdbDataFileEditor.cs
- Nodes.cs
- RawStylusInputCustomDataList.cs
- InstanceLockedException.cs
- SafePointer.cs
- UpdateEventArgs.cs
- ChooseAction.cs
- EntityContainerAssociationSetEnd.cs
- DataTable.cs
- SpellerInterop.cs
- HtmlInputPassword.cs
- VectorValueSerializer.cs
- MultipleCopiesCollection.cs
- MenuItemStyle.cs
- relpropertyhelper.cs
- ExtractedStateEntry.cs
- AuthorizationRule.cs
- TextContainerChangedEventArgs.cs
- JsonEnumDataContract.cs
- SQLMembershipProvider.cs