Activity Konstruktoren

Definition

Initialisiert eine neue Instanz der Activity-Klasse.

Überlädt

Activity()

Initialisiert eine neue Instanz der Activity-Klasse.

Activity(String)

Initialisiert eine neue Instanz der Activity-Klasse, während Name initialisiert wird.

Activity()

Initialisiert eine neue Instanz der Activity-Klasse.

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

Beispiele

Der folgende Code beschreibt das Erstellen von Aktivitäten und deren Hinzufügen als untergeordnete Elemente zu einer zusammengesetzten Aktivität.

Dieses Codebeispiel stammt aus dem Throw SDK-Beispiel und ist in der Datei ThrowWorkFlow.cs enthalten. Weitere Informationen finden Sie unter Throw Sample( Throw Sample).

this.CanModifyActivities = true;
System.Workflow.ComponentModel.ActivityBind activitybind1 = new System.Workflow.ComponentModel.ActivityBind();
this.throwActivity1 = new System.Workflow.ComponentModel.ThrowActivity();
activitybind1.Name = "ThrowWorkflow";
activitybind1.Path = "ThrownException";
//
// throwActivity1
//
this.throwActivity1.Name = "throwActivity1";
this.throwActivity1.SetBinding(System.Workflow.ComponentModel.ThrowActivity.FaultProperty, ((System.Workflow.ComponentModel.ActivityBind)(activitybind1)));
//
// ThrowWorkflow
//
this.Activities.Add(this.throwActivity1);
this.Name = "ThrowWorkflow";
this.CanModifyActivities = false;
Me.CanModifyActivities = True
Dim activitybind1 As New System.Workflow.ComponentModel.ActivityBind()
Me.throwActivity1 = New System.Workflow.ComponentModel.ThrowActivity()
activitybind1.Name = "ThrowWorkflow"
activitybind1.Path = "ThrownException"
' 
' throwActivity1
' 
Me.throwActivity1.Name = "throwActivity1"
Me.throwActivity1.SetBinding(System.Workflow.ComponentModel.ThrowActivity.FaultProperty, activitybind1)
' 
' ThrowWorkflow
' 
Me.Activities.Add(Me.throwActivity1)
Me.Name = "ThrowWorkflow"
Me.CanModifyActivities = False

Gilt für:

Activity(String)

Initialisiert eine neue Instanz der Activity-Klasse, während Name initialisiert wird.

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

Parameter

name
String

Der Name, der dieser Instanz zugeordnet wird. Der Name muss die Namenskonventionen für Variablen der Programmiersprache einhalten, die im Workflowprojekt verwendet wird, und im Workflow eindeutig sein.

Ausnahmen

name ist ein NULL-Verweis (Nothing in Visual Basic).

Gilt für: