共用方式為


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

適用於