SendActivity.ParameterBindings 属性

定义

获取 Windows Communication Foundation (WCF) 服务的形参表中可绑定参数的集合。

public:
 property System::Workflow::ComponentModel::WorkflowParameterBindingCollection ^ ParameterBindings { System::Workflow::ComponentModel::WorkflowParameterBindingCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Workflow.ComponentModel.WorkflowParameterBindingCollection ParameterBindings { get; }
[<System.ComponentModel.Browsable(false)>]
member this.ParameterBindings : System.Workflow.ComponentModel.WorkflowParameterBindingCollection
Public ReadOnly Property ParameterBindings As WorkflowParameterBindingCollection

属性值

要绑定到的参数的 WorkflowParameterBindingCollection

属性

示例

下面的示例演示如何访问 ParameterBindings 属性。 此示例从 Conversations SDK 示例改写而来。

channelToken1.EndpointName = "Shipper3Endpoint";
channelToken1.Name = "Shipper3Endpoint";
channelToken1.OwnerActivityName = "GetShippingQuotes";
RequestQuoteFromShipper3.ChannelToken = channelToken1;
RequestQuoteFromShipper3.Name = "RequestQuoteFromShipper3";
activityBind2.Name = "SupplierWorkflow";
activityBind2.Path = "order";
workflowParameterBinding2.ParameterName = "po";
workflowParameterBinding2.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activityBind2)));
activityBind3.Name = "SupplierWorkflow";
activityBind3.Path = "contextShipper3";
workflowParameterBinding3.ParameterName = "context";
workflowParameterBinding3.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activityBind3)));
activityBind4.Name = "SupplierWorkflow";
activityBind4.Path = "ackShipper3";
workflowParameterBinding4.ParameterName = "(ReturnValue)";
workflowParameterBinding4.SetBinding(System.Workflow.ComponentModel.WorkflowParameterBinding.ValueProperty, ((System.Workflow.ComponentModel.ActivityBind)(activityBind4)));
RequestQuoteFromShipper3.ParameterBindings.Add(workflowParameterBinding2);
RequestQuoteFromShipper3.ParameterBindings.Add(workflowParameterBinding3);
RequestQuoteFromShipper3.ParameterBindings.Add(workflowParameterBinding4);

注解

ParameterBindings 可用于指定服务操作参数与包含 SendActivity 活动的工作流的公共字段和属性之间的绑定。 当执行 SendActivity 活动时,会从参数所绑定的工作流属性中读取相应的参数值并将它们作为服务操作参数发送到服务中。

ParameterBindings 也可以用于检索服务操作的返回值。

服务操作的所有参数都应该进行绑定。 未绑定的服务操作参数将生成编译器警告,并且在调用 SendActivity 时将发送这些参数的默认值。

适用于