Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.WorkflowServices / System / ServiceModel / Activities / WorkflowClientDeliverMessageWrapper.cs / 1305376 / WorkflowClientDeliverMessageWrapper.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Activities { using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Runtime; using System.ServiceModel; using System.ServiceModel.Activities.Description; using System.ServiceModel.Channels; using System.Workflow.Activities; using System.Workflow.Runtime; using System.ServiceModel.Description; using System.ServiceModel.Diagnostics; class WorkflowClientDeliverMessageWrapper : IDeliverMessage { string baseUri; public WorkflowClientDeliverMessageWrapper(string baseUri) { this.baseUri = baseUri; } public object[] PrepareEventArgsArray(object sender, ExternalDataEventArgs eventArgs, out object workItem, out IPendingWork workHandler) { workItem = null; workHandler = null; return new object[] { sender, eventArgs }; } [SuppressMessage(FxCop.Category.Security, FxCop.Rule.AptcaMethodsShouldOnlyCallAptcaMethods, Justification = "Calling into already shipped assembly; can't apply APTCA")] public void DeliverMessage(ExternalDataEventArgs eventArgs, IComparable queueName, object message, object workItem, IPendingWork workHandler) { if (eventArgs == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("eventArgs"); } if (queueName == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("queueName"); } using (ExternalDataExchangeClient desClient = new ExternalDataExchangeClient(WorkflowRuntimeEndpoint.netNamedPipeContextBinding, new EndpointAddress(this.baseUri))) { using (OperationContextScope scope = new OperationContextScope((IContextChannel)desClient.InnerChannel)) { IContextManager contextManager = desClient.InnerChannel.GetProperty(); Fx.Assert(contextManager != null, "IContextManager must not be null."); if (contextManager != null) { IDictionary context = new Dictionary (); context["instanceId"] = eventArgs.InstanceId.ToString(); contextManager.SetContext(context); } desClient.RaiseEvent(eventArgs, queueName, message); } } } } } // 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
- RightsManagementPermission.cs
- IPipelineRuntime.cs
- ToolStripSeparator.cs
- WindowsPrincipal.cs
- InputLanguageCollection.cs
- PtsCache.cs
- Matrix3DStack.cs
- FlowDocumentFormatter.cs
- XslAstAnalyzer.cs
- TextBoxAutoCompleteSourceConverter.cs
- XmlEntity.cs
- OdbcConnectionOpen.cs
- HashCryptoHandle.cs
- EventProxy.cs
- LinqExpressionNormalizer.cs
- WebPartChrome.cs
- HostProtectionException.cs
- PageThemeCodeDomTreeGenerator.cs
- DesignerActionItemCollection.cs
- SessionEndedEventArgs.cs
- IIS7WorkerRequest.cs
- BrowsableAttribute.cs
- CommandConverter.cs
- ControlIdConverter.cs
- ListViewItemEventArgs.cs
- ParentUndoUnit.cs
- WindowsRebar.cs
- TdsEnums.cs
- RelativeSource.cs
- ExpressionBuilderContext.cs
- PointCollection.cs
- MatrixStack.cs
- ContextMenu.cs
- LinqToSqlWrapper.cs
- ContentValidator.cs
- EventDescriptorCollection.cs
- DeleteHelper.cs
- NonVisualControlAttribute.cs
- VectorAnimationBase.cs
- SerializationObjectManager.cs
- ComponentCommands.cs
- WebResponse.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- SevenBitStream.cs
- QueryExpression.cs
- OLEDB_Util.cs
- GridViewColumn.cs
- Symbol.cs
- CurrencyWrapper.cs
- InputManager.cs
- AppSettingsExpressionBuilder.cs
- _UriSyntax.cs
- MobileUserControl.cs
- localization.cs
- ProgressBar.cs
- QilUnary.cs
- GenericPrincipal.cs
- DependentList.cs
- Int64AnimationUsingKeyFrames.cs
- File.cs
- RoutedEventConverter.cs
- LayoutEditorPart.cs
- RepeatBehaviorConverter.cs
- WebPartChrome.cs
- _TLSstream.cs
- DataGridItem.cs
- CLSCompliantAttribute.cs
- PassportAuthentication.cs
- DbProviderFactoriesConfigurationHandler.cs
- ArgumentOutOfRangeException.cs
- TypeDelegator.cs
- DateTimeConverter.cs
- CommandEventArgs.cs
- MatrixStack.cs
- CatalogZoneBase.cs
- Page.cs
- coordinator.cs
- XmlSchemaSimpleTypeList.cs
- MetadataArtifactLoaderCompositeFile.cs
- SecureStringHasher.cs
- Geometry3D.cs
- HtmlInputReset.cs
- HostExecutionContextManager.cs
- PerformanceCountersBase.cs
- InkCanvasSelection.cs
- Gdiplus.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- FollowerQueueCreator.cs
- WebPartZoneBase.cs
- DefaultHttpHandler.cs
- CachedRequestParams.cs
- ReferencedAssembly.cs
- DataGridItemCollection.cs
- ToolStripSplitStackLayout.cs
- EntitySetBase.cs
- ResourcePermissionBase.cs
- CodeDelegateCreateExpression.cs
- ProcessHostConfigUtils.cs
- HwndProxyElementProvider.cs
- DragStartedEventArgs.cs