While 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在条件的计算结果为 true..
public ref class While sealed : System::Activities::NativeActivity
[System.Windows.Markup.ContentProperty("Body")]
public sealed class While : System.Activities.NativeActivity
[<System.Windows.Markup.ContentProperty("Body")>]
type While = class
inherit NativeActivity
Public NotInheritable Class While
Inherits NativeActivity
- 继承
- 属性
示例
下面的代码示例演示如何创建 While 活动。
new While
{
Condition = true,
Body = new Receive
{
ServiceContractName = Constants.POContractName,
OperationName = Constants.UpdatePOName,
CorrelatesWith = poidHandle, // identifies that the UpdatePO operation is waiting on the PurchaseOrderId that was used to initialize this handle
CorrelatesOn = new MessageQuerySet // the query that is used on an incoming message to find the requisite PurchaseOrderId specified in the correlation
{
// Id is the name of the incoming parameter within the PurchaseOrder
{ "PoId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:Id", Constants.XPathMessageContext) }
},
Content = ReceiveContent.Create(new OutArgument<PurchaseOrder>(po)) // creates a ReceiveMessageContent
}
},
构造函数
| 名称 | 说明 |
|---|---|
| While() |
创建活动的新实例 While 。 |
| While(Activity<Boolean>) |
创建活动的新实例 While 。 |
| While(Expression<Func<ActivityContext,Boolean>>) |
创建活动的新实例 While 。 |
属性
| 名称 | 说明 |
|---|---|
| Body |
在Activity |
| CacheId |
获取在工作流定义范围内唯一的缓存的标识符。 (继承自 Activity) |
| CanInduceIdle |
获取或设置一个值,该值指示活动是否可能导致工作流处于空闲状态。 (继承自 NativeActivity) |
| Condition |
在 Activity<TResult> 循环的每次迭代 |
| Constraints |
获取可配置为提供验证的活动Constraint集合Activity。 (继承自 Activity) |
| DisplayName |
获取或设置用于调试、验证、异常处理和跟踪的可选友好名称。 (继承自 Activity) |
| Id |
获取工作流定义范围中唯一的标识符。 (继承自 Activity) |
| Implementation |
活动的执行逻辑。 (继承自 NativeActivity) |
| ImplementationVersion |
获取或设置活动的实现版本。 (继承自 NativeActivity) |
| Variables |