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
- TableNameAttribute.cs
- StateMachineDesignerPaint.cs
- SortQuery.cs
- Switch.cs
- ViewGenResults.cs
- ProfileParameter.cs
- AuthenticationService.cs
- DetailsView.cs
- TypeTypeConverter.cs
- FormViewInsertEventArgs.cs
- SmtpReplyReaderFactory.cs
- KnownBoxes.cs
- OrthographicCamera.cs
- DesignBindingPropertyDescriptor.cs
- DesignerView.cs
- AttributeCollection.cs
- OracleConnectionStringBuilder.cs
- SimpleHandlerBuildProvider.cs
- CmsInterop.cs
- ObjectQuery_EntitySqlExtensions.cs
- Composition.cs
- DbBuffer.cs
- UnmanagedMemoryStream.cs
- Random.cs
- ConfigXmlSignificantWhitespace.cs
- EntityProviderFactory.cs
- Array.cs
- RIPEMD160.cs
- MasterPageBuildProvider.cs
- FileDialog.cs
- TaskSchedulerException.cs
- XmlByteStreamWriter.cs
- HttpPostedFile.cs
- RSAOAEPKeyExchangeDeformatter.cs
- FastPropertyAccessor.cs
- ElementHostAutomationPeer.cs
- PathHelper.cs
- CodeBlockBuilder.cs
- EntityTypeEmitter.cs
- ObjectRef.cs
- QilInvokeEarlyBound.cs
- TraceSource.cs
- UIPropertyMetadata.cs
- PkcsMisc.cs
- RemotingConfiguration.cs
- CultureSpecificCharacterBufferRange.cs
- NameObjectCollectionBase.cs
- BitSet.cs
- WindowsSysHeader.cs
- IndicFontClient.cs
- TogglePattern.cs
- RemoteCryptoDecryptRequest.cs
- SafeTokenHandle.cs
- DataTableTypeConverter.cs
- OleDbFactory.cs
- SafeLibraryHandle.cs
- IMembershipProvider.cs
- EntitySetRetriever.cs
- ExtendedPropertiesHandler.cs
- DynamicQueryableWrapper.cs
- CodeEntryPointMethod.cs
- NullableConverter.cs
- ManipulationVelocities.cs
- DataGridCaption.cs
- ToolStripLabel.cs
- LocationSectionRecord.cs
- GenericTypeParameterConverter.cs
- FlowDocumentPaginator.cs
- SqlServices.cs
- Soap12ProtocolReflector.cs
- TcpConnectionPoolSettings.cs
- XmlSecureResolver.cs
- EpmCustomContentSerializer.cs
- WebPartEditorOkVerb.cs
- DesignerActionUIService.cs
- OleDbReferenceCollection.cs
- DbMetaDataFactory.cs
- BooleanAnimationUsingKeyFrames.cs
- FileCodeGroup.cs
- DisplayNameAttribute.cs
- LogSwitch.cs
- WebConfigurationFileMap.cs
- Rotation3D.cs
- HtmlLink.cs
- PropertyValue.cs
- SatelliteContractVersionAttribute.cs
- XmlLanguageConverter.cs
- __TransparentProxy.cs
- TreeNodeStyle.cs
- UInt16Converter.cs
- SharedStatics.cs
- TextElementCollectionHelper.cs
- DataGridPreparingCellForEditEventArgs.cs
- EventToken.cs
- DataSourceBooleanViewSchemaConverter.cs
- HostingEnvironmentException.cs
- CodeDesigner.cs
- WindowsListViewItem.cs
- SelectQueryOperator.cs
- TrackingStringDictionary.cs