共用方式為


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 時會傳送參數的預設值。

適用於