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

適用於