Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Activities / System / ServiceModel / Activities / WorkflowHostingResponseContext.cs / 1305376 / WorkflowHostingResponseContext.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Activities { using System.Runtime; using System.ServiceModel.Activities.Dispatcher; using System.Threading; [Fx.Tag.XamlVisible(false)] public sealed class WorkflowHostingResponseContext { AsyncWaitHandle responseWaitHandle; WorkflowOperationContext context; object returnValue; object[] outputs; // Used by Creation Endpoint internal WorkflowHostingResponseContext() { this.responseWaitHandle = new AsyncWaitHandle(EventResetMode.AutoReset); } // Used by BookmarkResumption Endpoint internal WorkflowHostingResponseContext(WorkflowOperationContext context) { this.context = context; } public void SendResponse(object returnValue, object[] outputs) { this.returnValue = returnValue; this.outputs = outputs ?? EmptyArray.Allocate(0); if (this.responseWaitHandle != null) { this.responseWaitHandle.Set(); } else { Fx.Assert(this.context != null, "context must not be null!"); if (this.returnValue is Exception) { this.context.SendFault((Exception)this.returnValue); } else { this.context.SendReply(this.returnValue, this.outputs); } } } object GetResponse(out object[] outputs) { if (this.returnValue is Exception) { throw FxTrace.Exception.AsError((Exception)this.returnValue); } outputs = this.outputs; return this.returnValue; } internal IAsyncResult BeginGetResponse(TimeSpan timeout, AsyncCallback callback, object state) { Fx.Assert(this.responseWaitHandle != null, "this.responseWaitHandle must not be null!"); return GetResponseAsyncResult.Create(this, timeout, callback, state); } internal object EndGetResponse(IAsyncResult result, out object[] outputs) { return GetResponseAsyncResult.End(result, out outputs); } class GetResponseAsyncResult : AsyncResult { static Action
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Merger.cs
- HandlerBase.cs
- ServicePointManagerElement.cs
- PageWrapper.cs
- CategoryAttribute.cs
- IsolationInterop.cs
- URLMembershipCondition.cs
- TypeUsage.cs
- MeasureItemEvent.cs
- FormsAuthentication.cs
- SqlDependencyUtils.cs
- PackagingUtilities.cs
- OneOfScalarConst.cs
- Base64Stream.cs
- ScrollChrome.cs
- Size3DConverter.cs
- HwndStylusInputProvider.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- RelationshipConverter.cs
- DataSetFieldSchema.cs
- VectorAnimation.cs
- DropSource.cs
- QuerySettings.cs
- RewritingSimplifier.cs
- RegexTypeEditor.cs
- ItemsPresenter.cs
- TextTrailingCharacterEllipsis.cs
- BevelBitmapEffect.cs
- MessageSecurityOverHttp.cs
- ContextMarshalException.cs
- ActivationArguments.cs
- WebInvokeAttribute.cs
- SectionVisual.cs
- NotEqual.cs
- InOutArgumentConverter.cs
- ScrollViewer.cs
- UidManager.cs
- DataObjectMethodAttribute.cs
- ResumeStoryboard.cs
- Types.cs
- VirtualPathUtility.cs
- TextEmbeddedObject.cs
- XmlHierarchyData.cs
- LinqDataSourceContextData.cs
- EpmContentSerializer.cs
- PhysicalFontFamily.cs
- StyleBamlRecordReader.cs
- RotateTransform.cs
- Speller.cs
- ConvertersCollection.cs
- AccessKeyManager.cs
- FormViewModeEventArgs.cs
- DataGridViewRowConverter.cs
- ParamArrayAttribute.cs
- TextBreakpoint.cs
- HandlerFactoryWrapper.cs
- FtpWebRequest.cs
- XmlSchemaObjectTable.cs
- DirectionalLight.cs
- UserNamePasswordServiceCredential.cs
- RegexTree.cs
- XsltContext.cs
- UserPreferenceChangingEventArgs.cs
- TimeoutHelper.cs
- RIPEMD160Managed.cs
- TypedReference.cs
- Error.cs
- SoapMessage.cs
- CngAlgorithm.cs
- FullTextBreakpoint.cs
- ReadOnlyAttribute.cs
- StatusBarDrawItemEvent.cs
- DropAnimation.xaml.cs
- ObjectAnimationBase.cs
- RepeaterItemCollection.cs
- TakeOrSkipWhileQueryOperator.cs
- BoolExpression.cs
- StatusBar.cs
- SizeIndependentAnimationStorage.cs
- XmlSerializerAssemblyAttribute.cs
- WorkflowTraceTransfer.cs
- SecurityTokenProvider.cs
- ContentIterators.cs
- Query.cs
- MetadataUtil.cs
- SatelliteContractVersionAttribute.cs
- EventProvider.cs
- followingsibling.cs
- ValidationUtility.cs
- InvalidateEvent.cs
- DataSourceControlBuilder.cs
- WindowsTokenRoleProvider.cs
- MembershipUser.cs
- DragEventArgs.cs
- AssemblyBuilder.cs
- ToolboxComponentsCreatingEventArgs.cs
- DashStyle.cs
- TextReturnReader.cs
- ToolStripItemImageRenderEventArgs.cs
- ToolboxCategoryItems.cs