WorkflowDesignerLoader.OnEndLoad(Boolean, ICollection) 方法

定义

在设计器加载完成时调用。

protected:
 override void OnEndLoad(bool successful, System::Collections::ICollection ^ errors);
protected override void OnEndLoad (bool successful, System.Collections.ICollection errors);
override this.OnEndLoad : bool * System.Collections.ICollection -> unit
Protected Overrides Sub OnEndLoad (successful As Boolean, errors As ICollection)

参数

successful
Boolean

如果加载操作成功,则为 true;否则为 false

errors
ICollection

包含加载错误。

示例

下面的示例演示如何重写 OnEndLoad 方法以显示在加载工作流时可能出现的错误。

protected override void OnEndLoad(bool successful, ICollection errors)
{
    base.OnEndLoad(successful, errors);

    if (!successful && errors != null)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder("Errors\r\n");
        foreach (string error in errors)
        {
            sb.Append(error + "\r\n");
        }

        MessageBox.Show(sb.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}
Protected Overrides Sub OnEndLoad(ByVal successful As Boolean, ByVal errors As ICollection)
    MyBase.OnEndLoad(successful, errors)

    If Not successful And errors IsNot Nothing Then
        Dim sb As New System.Text.StringBuilder("Errors\r\n")
        For Each errorMessage As String In errors
            sb.Append(errorMessage + "\r\n")
        Next

        MessageBox.Show(sb.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub

适用于