Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / HttpAsyncResult.cs / 4 / 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
- FlowchartDesignerCommands.cs
- BulletChrome.cs
- ImageBrush.cs
- Stroke.cs
- DataGridViewCellFormattingEventArgs.cs
- PermissionSetTriple.cs
- IPCCacheManager.cs
- DbConnectionPoolIdentity.cs
- StatusBarDrawItemEvent.cs
- PenThreadPool.cs
- SqlDataSourceView.cs
- UniqueConstraint.cs
- Debug.cs
- SignatureDescription.cs
- GeneralTransformGroup.cs
- SqlServer2KCompatibilityAnnotation.cs
- DmlSqlGenerator.cs
- CompilerError.cs
- XmlSchemaParticle.cs
- InternalSendMessage.cs
- ProcessModule.cs
- AuthorizationSection.cs
- Executor.cs
- DocumentSchemaValidator.cs
- XmlObjectSerializerWriteContext.cs
- LineServicesRun.cs
- DependencyObjectType.cs
- SiteMapDataSource.cs
- TableLayoutColumnStyleCollection.cs
- BStrWrapper.cs
- SystemWebCachingSectionGroup.cs
- ProcessManager.cs
- WebServiceEnumData.cs
- SamlAssertion.cs
- MethodImplAttribute.cs
- _NegoStream.cs
- LambdaCompiler.Statements.cs
- ClientViaElement.cs
- TypeConverterHelper.cs
- AsymmetricKeyExchangeFormatter.cs
- FontWeight.cs
- XPathItem.cs
- Signature.cs
- DateTimeFormatInfoScanner.cs
- InvalidDataContractException.cs
- PrintEvent.cs
- datacache.cs
- LocalizableAttribute.cs
- TdsParserHelperClasses.cs
- ParsedAttributeCollection.cs
- LinkClickEvent.cs
- UrlAuthFailedErrorFormatter.cs
- ConnectionStringSettings.cs
- ISAPIApplicationHost.cs
- LayoutManager.cs
- While.cs
- QuaternionAnimation.cs
- WebPartTransformerAttribute.cs
- PageWrapper.cs
- DBCommandBuilder.cs
- ProvidersHelper.cs
- PerfCounterSection.cs
- SelectedGridItemChangedEvent.cs
- TextCollapsingProperties.cs
- ColumnResult.cs
- BooleanKeyFrameCollection.cs
- XmlEncoding.cs
- EditingScope.cs
- StoreItemCollection.Loader.cs
- TimeZone.cs
- LambdaReference.cs
- AdRotator.cs
- CellParaClient.cs
- RubberbandSelector.cs
- BuilderPropertyEntry.cs
- ReflectionTypeLoadException.cs
- InternalPolicyElement.cs
- PagePropertiesChangingEventArgs.cs
- ResourceKey.cs
- UpDownBase.cs
- Perspective.cs
- CollectionBuilder.cs
- XamlDesignerSerializationManager.cs
- login.cs
- SystemNetHelpers.cs
- HtmlWindow.cs
- UnescapedXmlDiagnosticData.cs
- ColorAnimation.cs
- AttributeAction.cs
- RuleSettings.cs
- DelegateSerializationHolder.cs
- ActivityDelegate.cs
- FixedSOMPageConstructor.cs
- ResourceManager.cs
- BufferModeSettings.cs
- MutexSecurity.cs
- NetworkInterface.cs
- RecordManager.cs
- RequestQueryParser.cs
- PermissionAttributes.cs