다음을 통해 공유


WorkflowPersistenceService.RestoreFromDefaultSerializedForm 메서드

정의

serialize된 형식에서 Activity를 복원합니다.

protected:
 static System::Workflow::ComponentModel::Activity ^ RestoreFromDefaultSerializedForm(cli::array <System::Byte> ^ activityBytes, System::Workflow::ComponentModel::Activity ^ outerActivity);
protected static System.Workflow.ComponentModel.Activity RestoreFromDefaultSerializedForm (byte[] activityBytes, System.Workflow.ComponentModel.Activity outerActivity);
static member RestoreFromDefaultSerializedForm : byte[] * System.Workflow.ComponentModel.Activity -> System.Workflow.ComponentModel.Activity
Protected Shared Function RestoreFromDefaultSerializedForm (activityBytes As Byte(), outerActivity As Activity) As Activity

매개 변수

activityBytes
Byte[]

Activity의 serialize된 형식입니다.

outerActivity
Activity

복원할 Activity를 포함하는 외부 Activity입니다.

반환

Activity

복원된 Activity입니다.

예제

다음 예제에서는 RestoreFromDefaultSerializedForm 메서드의 구현 방법을 보여 줍니다. 이 예제는 FilePersistenceService.cs 파일에 있는 Custom Persistence Service 샘플의 일부입니다. 자세한 내용은 Custom Persistence Service 샘플합니다.

// Load the completed activity state.
protected override Activity LoadCompletedContextActivity(Guid activityId, Activity outerActivity)
{
    Console.WriteLine("Loading completed activity context: {0}", activityId);
    byte[] workflowBytes = DeserializeFromFile(activityId);
    Activity deserializedActivities = WorkflowPersistenceService.RestoreFromDefaultSerializedForm(workflowBytes, outerActivity);
    return deserializedActivities;
}
' Load completed activity state.
Protected Overrides Function LoadCompletedContextActivity(ByVal scopeId As System.Guid, ByVal outerActivity As System.Workflow.ComponentModel.Activity) As System.Workflow.ComponentModel.Activity
    Console.WriteLine("Loading completed activity context: 0}", scopeId)
    Dim workflowBytes As Byte() = DeserializeFromFile(scopeId)
    Dim deserializedActivities As Activity = WorkflowPersistenceService.RestoreFromDefaultSerializedForm(workflowBytes, outerActivity)
    Return deserializedActivities
End Function

적용 대상