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
- EncryptedPackage.cs
- EnlistmentState.cs
- Matrix.cs
- Annotation.cs
- CodeArrayCreateExpression.cs
- SurrogateDataContract.cs
- ColorConvertedBitmap.cs
- DataGridViewRowsRemovedEventArgs.cs
- ScopelessEnumAttribute.cs
- MDIWindowDialog.cs
- HandlerMappingMemo.cs
- TextServicesDisplayAttribute.cs
- ConfigXmlReader.cs
- _CommandStream.cs
- DataGridViewCellPaintingEventArgs.cs
- OrderingExpression.cs
- ListViewInsertionMark.cs
- SecurityAccessDeniedException.cs
- XmlLangPropertyAttribute.cs
- DoubleAnimationUsingKeyFrames.cs
- PagePropertiesChangingEventArgs.cs
- HtmlInputPassword.cs
- SoapException.cs
- ClientScriptManager.cs
- WinEventTracker.cs
- DataGridViewCellStyle.cs
- XmlWriterTraceListener.cs
- XmlQueryType.cs
- DetailsViewUpdateEventArgs.cs
- FlowDocumentFormatter.cs
- XamlFilter.cs
- TransformBlockRequest.cs
- BoundField.cs
- HitTestParameters.cs
- ObjectDataSourceDisposingEventArgs.cs
- BackgroundFormatInfo.cs
- XmlSchemaComplexContentExtension.cs
- MetadataUtilsSmi.cs
- SAPICategories.cs
- BufferModesCollection.cs
- Evidence.cs
- Int32CollectionConverter.cs
- HttpListenerTimeoutManager.cs
- MouseActionValueSerializer.cs
- ImageAttributes.cs
- CodeMemberEvent.cs
- VideoDrawing.cs
- TCEAdapterGenerator.cs
- DataServiceSaveChangesEventArgs.cs
- DBCSCodePageEncoding.cs
- DataGridViewColumnCollection.cs
- sqlnorm.cs
- EntityDesignerDataSourceView.cs
- ListBoxAutomationPeer.cs
- MimeWriter.cs
- PassportPrincipal.cs
- FormViewRow.cs
- ToolBarButton.cs
- XamlInt32CollectionSerializer.cs
- ToolStripProgressBar.cs
- Double.cs
- IPAddressCollection.cs
- HashSetEqualityComparer.cs
- SystemIcons.cs
- XPathMultyIterator.cs
- WindowsFormsSynchronizationContext.cs
- WindowsEditBoxRange.cs
- DataGridViewElement.cs
- COM2Enum.cs
- CodeSpit.cs
- ListViewGroupCollectionEditor.cs
- ToolStripItemCollection.cs
- TypeConstant.cs
- Normalization.cs
- FormViewPageEventArgs.cs
- ServiceModelDictionary.cs
- DataControlFieldCollection.cs
- Pens.cs
- Win32.cs
- SizeAnimation.cs
- FileSecurity.cs
- DeviceContexts.cs
- WorkflowDesigner.cs
- ConversionContext.cs
- NameSpaceExtractor.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- SingleAnimationBase.cs
- WindowVisualStateTracker.cs
- ListViewAutomationPeer.cs
- OutOfMemoryException.cs
- Identity.cs
- DesignerProperties.cs
- AssociatedControlConverter.cs
- BaseComponentEditor.cs
- _FtpDataStream.cs
- CounterSet.cs
- EdmPropertyAttribute.cs
- EventLogPermissionAttribute.cs
- SystemIPGlobalStatistics.cs
- ColorConverter.cs