WorkflowDesignerLoader.LoadDesignerLayout(XmlReader, IList) Method
Definition
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.
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
- 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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기