Bewerken

Share via


SuspendActivity Constructors

Definition

Overloads

SuspendActivity()

Initializes a new instance of the SuspendActivity class.

SuspendActivity(String)

Initializes a new instance of the SuspendActivity class, along with the name for that activity.

SuspendActivity()

Initializes a new instance of the SuspendActivity class.

public:
 SuspendActivity();
public SuspendActivity ();
Public Sub New ()

Examples

This example illustrates using the constructor for a SuspendActivity, and other things discussed elsewhere within this type.

This code example is part of the Suspend and Terminate SDK sample and is from the SuspendAndTerminateWorkflow.Designer.cs file. For more information, see Using Suspend and Terminate.

[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

Remarks

The following table shows initial property values for an instance of the SuspendActivity class.

Property Value
Error Null (Nothing in Visual Basic).

Applies to

SuspendActivity(String)

Initializes a new instance of the SuspendActivity class, along with the name for that activity.

public:
 SuspendActivity(System::String ^ name);
public SuspendActivity (string name);
new System.Workflow.ComponentModel.SuspendActivity : string -> System.Workflow.ComponentModel.SuspendActivity
Public Sub New (name As String)

Parameters

name
String

The user-defined name of the activity.

Applies to