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
文件中的 ShipperWorkflow.designer.cs
SDK 示例改写。
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 的实例可用于为工作流优先协定方案配置接收活动。