WorkflowDesignerLoader.PerformFlush(IDesignerSerializationManager) Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Grava alterações em cache para o local do qual o designer foi carregado.
protected:
override void PerformFlush(System::ComponentModel::Design::Serialization::IDesignerSerializationManager ^ serializationManager);
protected override void PerformFlush (System.ComponentModel.Design.Serialization.IDesignerSerializationManager serializationManager);
override this.PerformFlush : System.ComponentModel.Design.Serialization.IDesignerSerializationManager -> unit
Protected Overrides Sub PerformFlush (serializationManager As IDesignerSerializationManager)
Parâmetros
- serializationManager
- IDesignerSerializationManager
Classe que implementa a interface IDesignerSerializationManager, que gerencia a serialização do tempo de design.
Exemplos
O exemplo a seguir demonstra como substituir o PerformFlush método para serializar o fluxo de trabalho usando o WorkflowMarkupSerializer.
public override void Flush()
{
this.PerformFlush(null);
}
protected override void PerformFlush(IDesignerSerializationManager manager)
{
IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
if (host != null && host.RootComponent != null)
{
Activity service = host.RootComponent as Activity;
if (service != null)
{
using (XmlWriter writer = XmlWriter.Create(this.xomlFile))
{
WorkflowMarkupSerializer xomlSerializer = new WorkflowMarkupSerializer();
if (manager == null)
{
xomlSerializer.Serialize(writer, service);
}
else
{
xomlSerializer.Serialize(manager, writer, service);
}
}
}
}
}
Public Overrides Sub Flush()
Me.PerformFlush(Nothing)
End Sub
Protected Overrides Sub PerformFlush(ByVal manager As IDesignerSerializationManager)
Dim host As IDesignerHost = CType(GetService(GetType(IDesignerHost)), IDesignerHost)
If host IsNot Nothing And host.RootComponent IsNot Nothing Then
Dim service As Activity = CType(host.RootComponent, Activity)
If service IsNot Nothing Then
Using writer As XmlWriter = XmlWriter.Create(Me.XomlFile)
Dim xomlSerializer As New WorkflowMarkupSerializer()
If manager IsNot Nothing Then
xomlSerializer.Serialize(writer, service)
Else
xomlSerializer.Serialize(manager, writer, service)
End If
End Using
End If
End If
End Sub