Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / HttpAsyncResult.cs / 2 / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DesignerWithHeader.cs
- DataGridViewCellValidatingEventArgs.cs
- ParameterRetriever.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- Pipe.cs
- GetMemberBinder.cs
- ThreadExceptionEvent.cs
- COM2ExtendedBrowsingHandler.cs
- SqlProcedureAttribute.cs
- EndpointNotFoundException.cs
- WebPartConnectionCollection.cs
- ConfigurationException.cs
- TextPattern.cs
- ContextMenu.cs
- MethodToken.cs
- OptimizerPatterns.cs
- MailWebEventProvider.cs
- DataGridViewCellValueEventArgs.cs
- Span.cs
- MinMaxParagraphWidth.cs
- XmlTextWriter.cs
- EnumDataContract.cs
- ResourcePool.cs
- DebugHandleTracker.cs
- PageAsyncTask.cs
- CompiledIdentityConstraint.cs
- Deserializer.cs
- WebBrowser.cs
- LocalValueEnumerator.cs
- ProviderSettings.cs
- CollectionChangedEventManager.cs
- SystemNetHelpers.cs
- ConfigurationSettings.cs
- EventSchemaTraceListener.cs
- WindowsEditBoxRange.cs
- SharingService.cs
- Int32Rect.cs
- DataGridPagerStyle.cs
- GcHandle.cs
- ListBoxAutomationPeer.cs
- CredentialCache.cs
- SiteIdentityPermission.cs
- LocalValueEnumerator.cs
- DescriptionAttribute.cs
- Latin1Encoding.cs
- ValidationErrorCollection.cs
- SqlVisitor.cs
- dbdatarecord.cs
- StorageScalarPropertyMapping.cs
- SuppressIldasmAttribute.cs
- WebPartConnectionsConfigureVerb.cs
- ParserHooks.cs
- SQLConvert.cs
- ServicePerformanceCounters.cs
- ToolBarButtonClickEvent.cs
- SecureConversationServiceCredential.cs
- DataGridViewBindingCompleteEventArgs.cs
- ReaderOutput.cs
- BlobPersonalizationState.cs
- ServiceOperation.cs
- CalendarDay.cs
- DbConnectionPoolGroupProviderInfo.cs
- DrawingVisualDrawingContext.cs
- CodeTypeConstructor.cs
- TemplateKeyConverter.cs
- ProcessingInstructionAction.cs
- FastPropertyAccessor.cs
- StreamAsIStream.cs
- _CookieModule.cs
- RequiredArgumentAttribute.cs
- HttpListenerPrefixCollection.cs
- ParenthesizePropertyNameAttribute.cs
- AnnotationResourceChangedEventArgs.cs
- GeometryModel3D.cs
- EntityDataSource.cs
- GPPOINTF.cs
- ScrollViewerAutomationPeer.cs
- ObjectAnimationBase.cs
- X509ThumbprintKeyIdentifierClause.cs
- SegmentInfo.cs
- __TransparentProxy.cs
- ApplicationInterop.cs
- CompoundFileStorageReference.cs
- FullTextBreakpoint.cs
- CodeObject.cs
- CircleHotSpot.cs
- _UriTypeConverter.cs
- EncryptedReference.cs
- Point3DConverter.cs
- RectKeyFrameCollection.cs
- TableLayoutRowStyleCollection.cs
- MatrixTransform3D.cs
- DataGridViewButtonColumn.cs
- CroppedBitmap.cs
- SoapFormatExtensions.cs
- SeekableMessageNavigator.cs
- TypeListConverter.cs
- SymmetricAlgorithm.cs
- HttpBrowserCapabilitiesBase.cs
- IntersectQueryOperator.cs