Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DefaultBindingPropertyAttribute.cs
- EdmProperty.cs
- SqlCacheDependency.cs
- XmlDownloadManager.cs
- DrawingVisual.cs
- DataGridViewIntLinkedList.cs
- StrongNameMembershipCondition.cs
- WrapperEqualityComparer.cs
- ReaderOutput.cs
- SpecularMaterial.cs
- WindowsMenu.cs
- EncodingNLS.cs
- RenderData.cs
- _Connection.cs
- KeyMatchBuilder.cs
- OptimizedTemplateContent.cs
- StatusBarItemAutomationPeer.cs
- ChangeInterceptorAttribute.cs
- GraphicsState.cs
- ConfigurationFileMap.cs
- BindMarkupExtensionSerializer.cs
- TableCellsCollectionEditor.cs
- TerminateWorkflow.cs
- NamespaceEmitter.cs
- WinFormsSecurity.cs
- ButtonRenderer.cs
- TypeUsage.cs
- EncryptedKeyHashIdentifierClause.cs
- Activator.cs
- SQLConvert.cs
- JournalEntry.cs
- ItemsChangedEventArgs.cs
- LoadRetryConstantStrategy.cs
- SizeConverter.cs
- StrokeDescriptor.cs
- XmlValidatingReader.cs
- XmlWriterSettings.cs
- assemblycache.cs
- PathData.cs
- ResourceReferenceExpression.cs
- StylusEditingBehavior.cs
- SchemaCollectionPreprocessor.cs
- IssuedTokensHeader.cs
- PermissionSet.cs
- HiddenFieldPageStatePersister.cs
- Pen.cs
- Group.cs
- ListenerElementsCollection.cs
- GPPOINTF.cs
- ReaderWriterLockSlim.cs
- InputQueueChannelAcceptor.cs
- UnmanagedMemoryStream.cs
- BaseComponentEditor.cs
- DynamicDocumentPaginator.cs
- InputGestureCollection.cs
- DataSourceCacheDurationConverter.cs
- MulticastOption.cs
- ToolStripContainer.cs
- XPathDocumentIterator.cs
- RTLAwareMessageBox.cs
- HttpWebRequest.cs
- TextDocumentView.cs
- UInt32Converter.cs
- DataGridViewCellStyle.cs
- RawUIStateInputReport.cs
- ChangeToolStripParentVerb.cs
- AnnotationAuthorChangedEventArgs.cs
- SimpleType.cs
- FormsAuthenticationUser.cs
- LedgerEntryCollection.cs
- WebPartConnection.cs
- ClientUtils.cs
- SqlTypeConverter.cs
- TableRowGroup.cs
- RegexCapture.cs
- ComponentResourceKey.cs
- AssemblyBuilder.cs
- HandlerWithFactory.cs
- ServiceContractGenerator.cs
- GenericIdentity.cs
- TrustLevelCollection.cs
- Directory.cs
- DbMetaDataColumnNames.cs
- XmlCDATASection.cs
- SecurityRuntime.cs
- BaseTemplateBuildProvider.cs
- BooleanKeyFrameCollection.cs
- UpDownEvent.cs
- LoginName.cs
- AsymmetricAlgorithm.cs
- RotateTransform.cs
- Asn1IntegerConverter.cs
- CapabilitiesState.cs
- TextEndOfLine.cs
- MenuDesigner.cs
- ApplicationDirectory.cs
- Polygon.cs
- DataGridViewMethods.cs
- ZipIOCentralDirectoryBlock.cs
- HostingEnvironmentException.cs