WorkflowDesignerLoader.OnEndLoad(Boolean, ICollection) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在设计器加载完成时调用。
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