Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / HttpAsyncResult.cs / 1 / 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
- ArrangedElementCollection.cs
- SQLMoneyStorage.cs
- ContainerFilterService.cs
- EmissiveMaterial.cs
- WeakReferenceKey.cs
- StorageEntityContainerMapping.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- AddValidationError.cs
- OneToOneMappingSerializer.cs
- SHA1.cs
- FontDifferentiator.cs
- ClrProviderManifest.cs
- CalendarButtonAutomationPeer.cs
- UnmanagedMemoryStreamWrapper.cs
- SpellerInterop.cs
- HostedTransportConfigurationManager.cs
- ConfigXmlComment.cs
- ObjectDataSourceEventArgs.cs
- SchemaTableOptionalColumn.cs
- MemberListBinding.cs
- SourceSwitch.cs
- Attributes.cs
- WorkflowMarkupSerializationProvider.cs
- ControlFilterExpression.cs
- DesignerVerbCollection.cs
- MetadataUtil.cs
- BaseDataListPage.cs
- TransformValueSerializer.cs
- OrderedDictionary.cs
- HierarchicalDataBoundControl.cs
- DefaultHttpHandler.cs
- CookieParameter.cs
- Point3DAnimationUsingKeyFrames.cs
- SymLanguageType.cs
- KeyPressEvent.cs
- Gdiplus.cs
- HttpModulesSection.cs
- ScrollPattern.cs
- KeyValuePair.cs
- TextShapeableCharacters.cs
- WorkerRequest.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Splitter.cs
- ProfileBuildProvider.cs
- IOThreadScheduler.cs
- GradientStop.cs
- BoundColumn.cs
- UnsafeNativeMethods.cs
- BaseAsyncResult.cs
- TabletDeviceInfo.cs
- ItemCollection.cs
- Matrix3D.cs
- FullTrustAssembly.cs
- TreeViewImageKeyConverter.cs
- DataGridViewControlCollection.cs
- DataGridViewCellStyleConverter.cs
- SplineKeyFrames.cs
- SqlDataSourceCache.cs
- DataGrid.cs
- NativeMethods.cs
- KeyboardNavigation.cs
- OAVariantLib.cs
- SchemaImporterExtension.cs
- ThreadAbortException.cs
- WsdlBuildProvider.cs
- EditorAttribute.cs
- TreeNodeCollection.cs
- SharedDp.cs
- Funcletizer.cs
- InstanceNameConverter.cs
- CompiledQueryCacheEntry.cs
- DataRecordInfo.cs
- XmlCollation.cs
- ColorDialog.cs
- RuntimeVariablesExpression.cs
- Select.cs
- ToolboxItemFilterAttribute.cs
- ChangeBlockUndoRecord.cs
- BindingUtils.cs
- ServiceHttpModule.cs
- WCFModelStrings.Designer.cs
- PassportPrincipal.cs
- LicenseManager.cs
- Main.cs
- FlowDocumentView.cs
- SystemParameters.cs
- DataGridViewSelectedRowCollection.cs
- TrackingMemoryStream.cs
- _NativeSSPI.cs
- PerfCounters.cs
- DispatcherExceptionFilterEventArgs.cs
- DesignerTextWriter.cs
- SelectionEditingBehavior.cs
- ResourceDictionaryCollection.cs
- ToolStripContentPanelRenderEventArgs.cs
- CodeCatchClauseCollection.cs
- DesigntimeLicenseContext.cs
- CellParaClient.cs
- HTTPAPI_VERSION.cs
- NamespaceCollection.cs