共用方式為


SuspendActivity.Error 屬性

定義

取得或設定要向管理員報告的錯誤訊息,提供暫止的原因。

public:
 property System::String ^ Error { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(true)]
public string Error { get; set; }
[<System.ComponentModel.Browsable(true)>]
member this.Error : string with get, set
Public Property Error As String

屬性值

String

提供工作流程執行個體暫止原因的錯誤訊息。 預設值是 null

屬性

範例

這個範例說明初始化 ErrorSuspendActivity 屬性,此型別內的其他概念已於他處討論。

這個程式碼範例是 SuspendAndTerminateWorkflow.Designer.cs 檔案中<暫止與結束 SDK>範例的一部分。 如需詳細資訊,請參閱 使用暫停和終止

[System.Diagnostics.DebuggerNonUserCode()]
private void InitializeComponent()
{
    this.CanModifyActivities = true;
    this.suspend = new System.Workflow.ComponentModel.SuspendActivity();
    this.consoleMessage = new System.Workflow.Activities.CodeActivity();
    this.terminate = new System.Workflow.ComponentModel.TerminateActivity();
    //
    // suspend
    //
    this.suspend.Error = null;
    this.suspend.Name = "suspend";
    //
    // ConsoleMessage
    //
    this.consoleMessage.Name = "consoleMessage";
    this.consoleMessage.ExecuteCode += new System.EventHandler(this.OnConsoleMessage);
    //
    // terminate
    //
    this.terminate.Error = null;
    this.terminate.Name = "terminate";
    //
    // SuspendAndTerminateWorkflow
    //
    this.Activities.Add(this.suspend);
    this.Activities.Add(this.consoleMessage);
    this.Activities.Add(this.terminate);
    this.Name = "SuspendAndTerminateWorkflow";
    this.CanModifyActivities = false;
}
<System.Diagnostics.DebuggerNonUserCode()> _
                            Private Sub InitializeComponent()

    Me.CanModifyActivities = True
    Me.suspend = New System.Workflow.ComponentModel.SuspendActivity()
    Me.consoleMessage = New System.Workflow.Activities.CodeActivity()
    Me.terminate = New System.Workflow.ComponentModel.TerminateActivity()
    ' 
    ' suspend
    ' 
    Me.suspend.Error = Nothing
    Me.suspend.Name = "suspend"
    ' 
    ' ConsoleMessage
    ' 
    Me.consoleMessage.Name = "consoleMessage"
    AddHandler Me.consoleMessage.ExecuteCode, AddressOf Me.OnConsoleMessage
    ' 
    ' terminate
    ' 
    Me.terminate.Error = Nothing
    Me.terminate.Name = "terminate"
    ' 
    ' SuspendAndTerminateWorkflow
    ' 
    Me.Activities.Add(Me.suspend)
    Me.Activities.Add(Me.consoleMessage)
    Me.Activities.Add(Me.terminate)
    Me.Name = "SuspendAndTerminateWorkflow"
    Me.CanModifyActivities = False
End Sub

備註

這個錯誤訊息的傳用是由主提供者 (執行個體管理員或持續性提供者) 所決定。

適用於