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
- UndirectedGraph.cs
- RenderDataDrawingContext.cs
- BinaryParser.cs
- RolePrincipal.cs
- ModuleElement.cs
- _Connection.cs
- Util.cs
- InvokeWebServiceDesigner.cs
- FormatConvertedBitmap.cs
- PathStreamGeometryContext.cs
- UserControlCodeDomTreeGenerator.cs
- TypeLibConverter.cs
- SqlGenerator.cs
- _HeaderInfoTable.cs
- CodeThrowExceptionStatement.cs
- StickyNote.cs
- MachineKeySection.cs
- MonthCalendar.cs
- BindingElement.cs
- FilterQuery.cs
- AppSettingsSection.cs
- Math.cs
- SafeSystemMetrics.cs
- ArraySortHelper.cs
- WebPartManagerInternals.cs
- SamlDelegatingWriter.cs
- HyperLinkStyle.cs
- SafeViewOfFileHandle.cs
- Translator.cs
- ContentOnlyMessage.cs
- TraceInternal.cs
- SoapFault.cs
- RouteItem.cs
- WinEventQueueItem.cs
- XmlTextWriter.cs
- DirectionalLight.cs
- HttpWebResponse.cs
- WebPartZoneBase.cs
- MultiPartWriter.cs
- UnsafeNativeMethods.cs
- DoubleLink.cs
- IndexerNameAttribute.cs
- XmlSchemaSimpleTypeUnion.cs
- SoapFault.cs
- StdValidatorsAndConverters.cs
- DataSetViewSchema.cs
- WaitHandle.cs
- MessageSecurityOverMsmq.cs
- EntityDataSourceReferenceGroup.cs
- XmlSerializationWriter.cs
- AssociationProvider.cs
- BindingNavigator.cs
- PointLight.cs
- Module.cs
- HttpHandlerAction.cs
- EventWaitHandle.cs
- TdsValueSetter.cs
- ImportStoreException.cs
- SignatureDescription.cs
- WindowsEditBox.cs
- XmlReflectionMember.cs
- TableLayoutStyleCollection.cs
- TraceSection.cs
- DispatcherEventArgs.cs
- BrushValueSerializer.cs
- ProfileService.cs
- ProjectedSlot.cs
- TreeViewHitTestInfo.cs
- WebConfigurationHostFileChange.cs
- connectionpool.cs
- XamlTypeMapper.cs
- KeyValueConfigurationElement.cs
- UserControl.cs
- OracleBFile.cs
- BaseProcessor.cs
- Encoder.cs
- RouteValueDictionary.cs
- CannotUnloadAppDomainException.cs
- PolicyManager.cs
- FilterEventArgs.cs
- StructuralObject.cs
- BinHexEncoder.cs
- TypefaceMap.cs
- DataBindingHandlerAttribute.cs
- RedirectionProxy.cs
- DocumentScope.cs
- CompilerGeneratedAttribute.cs
- _FtpControlStream.cs
- DBNull.cs
- IList.cs
- Container.cs
- SqlMethods.cs
- FontDifferentiator.cs
- ByteStreamGeometryContext.cs
- WindowsTokenRoleProvider.cs
- DataSourceView.cs
- Drawing.cs
- ContractMapping.cs
- RewritingProcessor.cs
- figurelengthconverter.cs