Export (0) Print
Expand All

WorkflowDesignerLoader.LoadDesignerLayout Method

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

Namespace: System.Workflow.ComponentModel.Design
Assembly: System.Workflow.ComponentModel (in system.workflow.componentmodel.dll)

protected void LoadDesignerLayout (
	XmlReader layoutReader,
	out IList layoutLoadErrors
)
protected void LoadDesignerLayout (
	XmlReader layoutReader, 
	/** @attribute OutAttribute() */ /** @ref */ IList layoutLoadErrors
)
Not applicable.

Parameters

layoutReader

An XmlReader that is created for the serialized layout.

layoutLoadErrors

List of errors that occurred during the deserialization.

This example shows how to load the layout for a specific workflow definition using the LoadDesignerLayout method. An XmlReader object is created using the filename of a designer layout file that was created using SaveDesignerLayout. When the layout has finished loading any errors that may 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);
        }
    }
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft