Activity.Name 屬性

定義

取得或設定這個執行個體的名稱。 這個名稱必須符合工作流程專案中所使用之程式語言的變數命名慣例。

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

屬性值

此執行個體的名稱。

屬性

範例

下列程式碼將示範如何建立活動,並將活動當做子系加入至複合活動,並設定 Name 的值。

這個程式碼範例是 ThrowWorkflow.cs 檔案中<擲回 SDK>範例的一部分。 如需詳細資訊,請參閱 擲回範例

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

備註

這個的預設值為空白字串。

這個屬性為中繼屬性,表示它無法在執行階段變更。 中繼屬性在執行階段時建立屬性執行個體後不會變更,因此該屬性在設計階段時必須設定為常值。

適用於