WorkflowPersistenceService.RestoreFromDefaultSerializedForm Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Restores the Activity from its serialized form.
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
The restored Activity.
The following example demonstrates an implementation of the RestoreFromDefaultSerializedForm
method. This example is from the Custom Persistence Service sample, from the FilePersistenceService.cs file. For more information, see Custom Persistence Service Sample.
// 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
Produkt | Versjoner |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET-tilbakemelding
.NET er et åpen kilde-prosjekt. Velg en kobling for å gi tilbakemelding: