Επεξεργασία

Κοινή χρήση μέσω


WorkflowDesignerLoader.LoadDesignerLayout(XmlReader, IList) Method

Definition

Applies the serialized layout to the root designer in the current designer host.

protected:
 void LoadDesignerLayout(System::Xml::XmlReader ^ layoutReader, [Runtime::InteropServices::Out] System::Collections::IList ^ % layoutLoadErrors);
protected void LoadDesignerLayout (System.Xml.XmlReader layoutReader, out System.Collections.IList layoutLoadErrors);
member this.LoadDesignerLayout : System.Xml.XmlReader * IList -> unit
Protected Sub LoadDesignerLayout (layoutReader As XmlReader, ByRef layoutLoadErrors As IList)

Parameters

layoutReader
XmlReader

An XmlReader that is created for the serialized layout.

layoutLoadErrors
IList

List of errors that occurred during the deserialization.

Examples

This example shows how to load the layout for a specific workflow definition using the LoadDesignerLayout method. An XmlReader object is created using the file name of a designer layout file that was created using SaveDesignerLayout. When the layout has finished loading, any errors that might have occurred are displayed to the user.

public void LoadLayout()
{
    using (XmlReader reader = XmlReader.Create("wfInstanceId.designer.xml"))
    {
        IList layoutLoadErrors = new ArrayList() as IList;
        this.LoadDesignerLayout(reader, out layoutLoadErrors);

        if (layoutLoadErrors.Count > 0)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("Errors:\r\n");
            foreach (WorkflowMarkupSerializationException error in layoutLoadErrors)
            {
                sb.Append(error.Message + "\r\n");
            }
            MessageBox.Show(sb.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}
Public Sub LoadLayout()
    Using reader As XmlReader = XmlReader.Create("wfInstanceId.designer.xml")

        Dim layoutLoadErrors As IList = CType(New ArrayList(), IList)
        Me.LoadDesignerLayout(reader, layoutLoadErrors)

        If layoutLoadErrors.Count > 0 Then
            Dim sb As New System.Text.StringBuilder("Errors:\r\n")
            For Each errorMessage As WorkflowMarkupSerializationException In layoutLoadErrors
                sb.Append(errorMessage.Message + "\r\n")
            Next
            MessageBox.Show(sb.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

        End If
    End Using
End Sub

Applies to