WorkflowPersistenceService.RestoreFromDefaultSerializedForm 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从其序列化的窗体中还原 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
参数
返回
已还原的 Activity。
示例
下面的示例演示 RestoreFromDefaultSerializedForm
方法的实现。 此示例摘自 FilePersistenceService.cs 文件中的“自定义持久性服务”示例。 有关详细信息,请参阅 自定义持久性服务示例。
// 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