WorkflowPersistenceService.RestoreFromDefaultSerializedForm Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Restaura Activity a partir de su formulario serializado.
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
Parámetros
Devoluciones
La clase Activity restaurada.
Ejemplos
En el siguiente ejemplo se muestra una implementación del método RestoreFromDefaultSerializedForm
. Este ejemplo pertenece a la muestra Servicio de persistencia personalizado, del archivo FilePersistenceService.cs. Para obtener más información, consulte Ejemplo de 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