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
- ResourceExpression.cs
- NoClickablePointException.cs
- X509Certificate.cs
- RepeatBehavior.cs
- CodeAttachEventStatement.cs
- WebSysDefaultValueAttribute.cs
- FileSystemWatcher.cs
- HelpEvent.cs
- ActivityCodeDomReferenceService.cs
- UIElementIsland.cs
- ServiceProviders.cs
- XsdSchemaFileEditor.cs
- WorkflowFileItem.cs
- InputChannel.cs
- ActivitiesCollection.cs
- ClaimComparer.cs
- HttpCookie.cs
- XmlFormatExtensionPrefixAttribute.cs
- ConnectionProviderAttribute.cs
- BitmapFrameDecode.cs
- SystemParameters.cs
- TreeIterators.cs
- ImageDesigner.cs
- BrowserCapabilitiesCompiler.cs
- CommandDesigner.cs
- ControlPropertyNameConverter.cs
- HandoffBehavior.cs
- ASCIIEncoding.cs
- DataObject.cs
- RtType.cs
- CultureInfo.cs
- ValidatorCollection.cs
- ProfileBuildProvider.cs
- DBCommandBuilder.cs
- DbDataSourceEnumerator.cs
- SourceInterpreter.cs
- PromptStyle.cs
- CompensationToken.cs
- RuntimeHelpers.cs
- IndentTextWriter.cs
- _NetRes.cs
- XmlSchemaAnyAttribute.cs
- HtmlInputPassword.cs
- NodeFunctions.cs
- PropertyDescriptorGridEntry.cs
- ShaperBuffers.cs
- AddInIpcChannel.cs
- Adorner.cs
- BamlLocalizableResource.cs
- ErrorStyle.cs
- PermissionSet.cs
- BitmapFrameDecode.cs
- PageBreakRecord.cs
- DoubleLinkList.cs
- basenumberconverter.cs
- WebServicesInteroperability.cs
- SqlConnectionString.cs
- ProfileManager.cs
- Calendar.cs
- SizeConverter.cs
- FacetValues.cs
- AppDomainProtocolHandler.cs
- CodeDomSerializer.cs
- SizeAnimationClockResource.cs
- TableLayoutSettings.cs
- DataGridViewTextBoxColumn.cs
- Geometry.cs
- CommentEmitter.cs
- unsafenativemethodsother.cs
- SqlDataSourceParameterParser.cs
- ExtendedProperty.cs
- RoleGroup.cs
- BaseValidator.cs
- FixedHighlight.cs
- AssociationTypeEmitter.cs
- HMACSHA256.cs
- PerformanceCounterPermission.cs
- FrugalList.cs
- DataPagerFieldCollection.cs
- safex509handles.cs
- AutomationPropertyInfo.cs
- DesignerAdapterAttribute.cs
- PauseStoryboard.cs
- ToolStripDesigner.cs
- PageAsyncTaskManager.cs
- HMACSHA512.cs
- WindowsEditBoxRange.cs
- CommandEventArgs.cs
- EdmFunction.cs
- MonitoringDescriptionAttribute.cs
- FixedTextSelectionProcessor.cs
- DynamicHyperLink.cs
- Part.cs
- DataGridViewCellValueEventArgs.cs
- XPathDocumentIterator.cs
- AllMembershipCondition.cs
- OuterGlowBitmapEffect.cs
- RuntimeHandles.cs
- SmtpNegotiateAuthenticationModule.cs
- MonthChangedEventArgs.cs