WorkflowApplication.PersistableIdle 属性

定义

获取或设置当前工作流实例处于空闲状态并可被保留时调用的代理。

public:
 property Func<System::Activities::WorkflowApplicationIdleEventArgs ^, System::Activities::PersistableIdleAction> ^ PersistableIdle { Func<System::Activities::WorkflowApplicationIdleEventArgs ^, System::Activities::PersistableIdleAction> ^ get(); void set(Func<System::Activities::WorkflowApplicationIdleEventArgs ^, System::Activities::PersistableIdleAction> ^ value); };
public Func<System.Activities.WorkflowApplicationIdleEventArgs,System.Activities.PersistableIdleAction> PersistableIdle { get; set; }
member this.PersistableIdle : Func<System.Activities.WorkflowApplicationIdleEventArgs, System.Activities.PersistableIdleAction> with get, set
Public Property PersistableIdle As Func(Of WorkflowApplicationIdleEventArgs, PersistableIdleAction)

属性值

在当前工作流实例处于空闲状态并可以持久保存时调用的委托。

示例

下面的示例处理 PersistableIdle 处理程序并指示运行时保留并卸载工作流。

wfApp.PersistableIdle = delegate(WorkflowApplicationIdleEventArgs e)
{
    // Instruct the runtime to persist and unload the workflow
    return PersistableIdleAction.Unload;
};

注解

工作流进入空闲状态并可以保留时,将依次调用 IdlePersistableIdlePersistableIdle 处理程序返回以下 PersistableIdleAction 枚举值之一:NonePersistUnload

适用于