ReceiveActivity.ServiceOperationInfo 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
定義 ReceiveActivity 活動實作的合約與服務作業。
public:
property System::Workflow::Activities::OperationInfoBase ^ ServiceOperationInfo { System::Workflow::Activities::OperationInfoBase ^ get(); void set(System::Workflow::Activities::OperationInfoBase ^ value); };
[System.ComponentModel.Browsable(true)]
public System.Workflow.Activities.OperationInfoBase ServiceOperationInfo { get; set; }
[<System.ComponentModel.Browsable(true)>]
member this.ServiceOperationInfo : System.Workflow.Activities.OperationInfoBase with get, set
Public Property ServiceOperationInfo As OperationInfoBase
屬性值
OperationInfoBase 物件,此物件包含合約名稱、合約類型、作業名稱 (可能與方法名稱不同)、該作業是否為單向作業,以及包含作業相關參數的方法資訊。
- 屬性
範例
下列範例將示範如何存取 ServiceOperationInfo
屬性。 這段程式碼是來自 Conversations
SDK 範例的 ShipperWorkflow.designer.cs
檔案。
ReceiveActivity receiveQuoteFromShipper1 = new ReceiveActivity();
CodeActivity shipper1ShippingQuote = new CodeActivity();
ContextToken contextToken1 = new ContextToken();
ActivityBind activityBind1 = new ActivityBind();
WorkflowParameterBinding workflowParameterBinding1 = new WorkflowParameterBinding();
TypedOperationInfo typedOperationInfo1 = new TypedOperationInfo();
receiveQuoteFromShipper1.Activities.Add(shipper1ShippingQuote);
contextToken1.Name = "Shipper1Context";
contextToken1.OwnerActivityName = "GetShippingQuotes";
receiveQuoteFromShipper1.ContextToken = contextToken1;
receiveQuoteFromShipper1.Name = "receiveQuoteFromShipper1";
activityBind1.Name = "SupplierWorkflow";
activityBind1.Path = "quoteShipper1";
workflowParameterBinding1.ParameterName = "quote";
workflowParameterBinding1.SetBinding(WorkflowParameterBinding.ValueProperty, ((ActivityBind)(activityBind1)));
receiveQuoteFromShipper1.ParameterBindings.Add(workflowParameterBinding1);
typedOperationInfo1.ContractType = typeof(IShippingQuote);
typedOperationInfo1.Name = "ShippingQuote";
receiveQuoteFromShipper1.ServiceOperationInfo = typedOperationInfo1;
備註
ServiceOperationInfo 屬性可以設定為型別 TypedOperationInfo 或 OperationInfo 的執行個體。 TypedOperationInfo 可用來使用現有的 Windows Communication Foundation (WCF) 服務合約來設定接收活動。
OperationInfo 執行個體可用來設定工作流程優先合約案例的接收活動。