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
- MobileControlsSectionHandler.cs
- InputProcessorProfiles.cs
- Bits.cs
- HttpWebRequestElement.cs
- SoapServerProtocol.cs
- SettingsPropertyValue.cs
- StandardMenuStripVerb.cs
- EnumerableWrapperWeakToStrong.cs
- HtmlInputReset.cs
- DiagnosticTrace.cs
- PipelineModuleStepContainer.cs
- SmtpAuthenticationManager.cs
- BuildProviderUtils.cs
- InputLanguageEventArgs.cs
- XmlFormatWriterGenerator.cs
- ValidationRuleCollection.cs
- CircleHotSpot.cs
- ProjectionCamera.cs
- DataListItem.cs
- AsyncPostBackErrorEventArgs.cs
- XPathNavigatorReader.cs
- OdbcRowUpdatingEvent.cs
- TreeView.cs
- StringCollection.cs
- UDPClient.cs
- RuntimeEnvironment.cs
- ToolBarOverflowPanel.cs
- ActiveXContainer.cs
- PageThemeParser.cs
- Byte.cs
- SqlDependencyUtils.cs
- Metadata.cs
- TextTreeTextElementNode.cs
- LoginView.cs
- BaseDataBoundControlDesigner.cs
- XhtmlBasicListAdapter.cs
- PreservationFileWriter.cs
- loginstatus.cs
- WmpBitmapEncoder.cs
- JsonClassDataContract.cs
- FontFamily.cs
- ASCIIEncoding.cs
- GCHandleCookieTable.cs
- ColumnResult.cs
- BoundField.cs
- CultureTable.cs
- SelectionUIService.cs
- GZipUtils.cs
- ImageIndexConverter.cs
- PagedDataSource.cs
- WeakReferenceList.cs
- HighlightOverlayGlyph.cs
- basemetadatamappingvisitor.cs
- MessageParameterAttribute.cs
- FormatSettings.cs
- SyndicationSerializer.cs
- IDQuery.cs
- XmlCharCheckingWriter.cs
- DatePickerTextBox.cs
- ImageSource.cs
- ProgressBarBrushConverter.cs
- AmbiguousMatchException.cs
- PriorityQueue.cs
- TargetPerspective.cs
- OdbcParameterCollection.cs
- SqlBuilder.cs
- ObjectStateManager.cs
- Funcletizer.cs
- Int64.cs
- ArraySortHelper.cs
- ImageSourceConverter.cs
- TitleStyle.cs
- ObjectDataSourceSelectingEventArgs.cs
- DataGridSortCommandEventArgs.cs
- FieldAccessException.cs
- LostFocusEventManager.cs
- CorrelationKeyCalculator.cs
- DrawTreeNodeEventArgs.cs
- ACE.cs
- Int16Animation.cs
- HtmlWindow.cs
- CodeAttributeArgument.cs
- StaticContext.cs
- MenuItemBinding.cs
- TreeBuilder.cs
- CommandPlan.cs
- Propagator.Evaluator.cs
- NumberSubstitution.cs
- PriorityItem.cs
- InputDevice.cs
- ListViewItem.cs
- CollectionDataContract.cs
- WebPartHelpVerb.cs
- ThemeableAttribute.cs
- CodeFieldReferenceExpression.cs
- ElementNotAvailableException.cs
- BindingCompleteEventArgs.cs
- IndexOutOfRangeException.cs
- OdbcConnection.cs
- Parser.cs