Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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 } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Pkcs9Attribute.cs
- AdRotatorDesigner.cs
- DefinitionBase.cs
- HttpListenerResponse.cs
- Opcode.cs
- XmlSignificantWhitespace.cs
- ResourcesBuildProvider.cs
- QilValidationVisitor.cs
- _ListenerResponseStream.cs
- DataServiceRequest.cs
- AsyncOperation.cs
- SpeechDetectedEventArgs.cs
- JournalEntryStack.cs
- _SSPIWrapper.cs
- SafeFileMappingHandle.cs
- DispatcherExceptionFilterEventArgs.cs
- ProviderUtil.cs
- NavigationFailedEventArgs.cs
- GeneralTransform2DTo3DTo2D.cs
- SelectionProcessor.cs
- SqlDataSourceEnumerator.cs
- CheckBoxList.cs
- WebPartUserCapability.cs
- InternalConfigHost.cs
- AssemblyFilter.cs
- CodeMethodInvokeExpression.cs
- Polygon.cs
- PenLineCapValidation.cs
- CellTreeNodeVisitors.cs
- RemoteWebConfigurationHost.cs
- FilterException.cs
- _BufferOffsetSize.cs
- XmlBoundElement.cs
- HttpCapabilitiesSectionHandler.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- CollectionContainer.cs
- ScaleTransform.cs
- HtmlHistory.cs
- RepeaterItem.cs
- FilteredAttributeCollection.cs
- MethodBody.cs
- NullableFloatAverageAggregationOperator.cs
- DeviceFiltersSection.cs
- ConcurrentQueue.cs
- XmlSchemaSequence.cs
- Funcletizer.cs
- VisualBrush.cs
- BinaryObjectWriter.cs
- Directory.cs
- QilCloneVisitor.cs
- DocumentViewerAutomationPeer.cs
- ScriptingJsonSerializationSection.cs
- BuildProviderAppliesToAttribute.cs
- StringDictionary.cs
- COM2Enum.cs
- DataControlHelper.cs
- HeaderLabel.cs
- PersonalizationDictionary.cs
- IdentityHolder.cs
- RenamedEventArgs.cs
- StaticResourceExtension.cs
- MethodCallConverter.cs
- SqlExpander.cs
- XmlSchemaAnnotation.cs
- Environment.cs
- GeneralTransform3DTo2D.cs
- GenericTypeParameterConverter.cs
- Debugger.cs
- ResetableIterator.cs
- HttpFileCollection.cs
- VectorCollectionValueSerializer.cs
- DisplayNameAttribute.cs
- CharConverter.cs
- DetailsViewPageEventArgs.cs
- ViewgenGatekeeper.cs
- EncoderFallback.cs
- UiaCoreProviderApi.cs
- CodeGroup.cs
- HttpInputStream.cs
- DataGridView.cs
- ObjectNotFoundException.cs
- ConcurrentDictionary.cs
- QueryReaderSettings.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- SortQuery.cs
- ApplicationBuildProvider.cs
- XmlTextWriter.cs
- Accessors.cs
- ContainerUtilities.cs
- XslVisitor.cs
- UndirectedGraph.cs
- FileUpload.cs
- ApplicationManager.cs
- NativeMethods.cs
- Globals.cs
- DbProviderServices.cs
- HyperLink.cs
- NativeMethods.cs
- Vector3DCollection.cs
- MemoryRecordBuffer.cs