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
- InkCanvas.cs
- SequenceNumber.cs
- WebPartConnectionsConnectVerb.cs
- AxWrapperGen.cs
- BufferBuilder.cs
- StaticFileHandler.cs
- Thickness.cs
- XPathException.cs
- XmlBaseReader.cs
- lengthconverter.cs
- unitconverter.cs
- FragmentNavigationEventArgs.cs
- UmAlQuraCalendar.cs
- QilTargetType.cs
- RSAProtectedConfigurationProvider.cs
- EntityAdapter.cs
- DBAsyncResult.cs
- IResourceProvider.cs
- HostedNamedPipeTransportManager.cs
- CodeCompiler.cs
- ListParagraph.cs
- EventTrigger.cs
- EntityViewGenerator.cs
- SecurityUniqueId.cs
- HelloMessage11.cs
- MulticastIPAddressInformationCollection.cs
- Trustee.cs
- DefaultHttpHandler.cs
- RealProxy.cs
- TextBox.cs
- SafeNativeMethodsOther.cs
- HtmlTextViewAdapter.cs
- CollectionEditVerbManager.cs
- MsmqIntegrationSecurityElement.cs
- Internal.cs
- CatalogZoneAutoFormat.cs
- DbConnectionPoolCounters.cs
- NumberFormatter.cs
- DataGridViewCell.cs
- ReflectionServiceProvider.cs
- SingleObjectCollection.cs
- PriorityQueue.cs
- TextEditor.cs
- TemplateControl.cs
- UdpDiscoveryEndpointElement.cs
- PointIndependentAnimationStorage.cs
- Translator.cs
- ButtonBase.cs
- Compiler.cs
- UserMapPath.cs
- StyleSelector.cs
- CurrencyWrapper.cs
- BinHexDecoder.cs
- Object.cs
- TextTreeRootNode.cs
- PartialCachingControl.cs
- SelectionChangedEventArgs.cs
- SqlCommand.cs
- SqlPersistenceProviderFactory.cs
- ClientSideQueueItem.cs
- XmlParser.cs
- StylusPointPropertyId.cs
- FileEnumerator.cs
- ADRole.cs
- XmlUtil.cs
- OdbcHandle.cs
- Bitmap.cs
- DesignTimeXamlWriter.cs
- PageResolution.cs
- DesignerTextWriter.cs
- PrivilegedConfigurationManager.cs
- DataObjectSettingDataEventArgs.cs
- ExpressionBuilder.cs
- Int32Animation.cs
- StringDictionaryEditor.cs
- ObjectNavigationPropertyMapping.cs
- RemotingException.cs
- QueryAccessibilityHelpEvent.cs
- ExpressionBuilderContext.cs
- FileLogRecordStream.cs
- TerminateSequenceResponse.cs
- Focus.cs
- PropertyGroupDescription.cs
- AspNetHostingPermission.cs
- EventEntry.cs
- View.cs
- ActivationArguments.cs
- DictionaryGlobals.cs
- ScriptingSectionGroup.cs
- DelegatedStream.cs
- CodeExpressionRuleDeclaration.cs
- UnSafeCharBuffer.cs
- DoubleAnimationUsingPath.cs
- AsyncStreamReader.cs
- EntityDataSourceStatementEditor.cs
- FamilyTypeface.cs
- RectangleGeometry.cs
- ExceptionAggregator.cs
- ExternalFile.cs
- CaseExpr.cs