ActivityBind 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 ActivityBind 類別的新執行個體。
多載
ActivityBind() |
初始化 ActivityBind 類別的新執行個體。 |
ActivityBind(String) |
以 ActivityBind 參數,初始化 |
ActivityBind(String, String) |
以 ActivityBind 和 |
ActivityBind()
初始化 ActivityBind 類別的新執行個體。
public:
ActivityBind();
public ActivityBind ();
Public Sub New ()
範例
這個範例說明建立和使用 ActivityBind。
這個程式碼範例是 ThrowActivity.cs 檔案中<擲回活動 SDK>範例的一部分。 如需詳細資訊,請參閱 使用 ThrowActivity 活動。
public sealed partial class ThrowWorkflow : SequentialWorkflowActivity
{
[System.Diagnostics.DebuggerNonUserCode()]
private void InitializeComponent()
{
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;
}
private Exception thrownExceptionValue = new System.Exception("My Exception Message.");
public Exception ThrownException
{
get { return thrownExceptionValue; }
set { thrownExceptionValue = value; }
}
private ThrowActivity throwActivity1;
}
Partial Public NotInheritable Class ThrowWorkflow
Inherits SequentialWorkflowActivity
<System.Diagnostics.DebuggerNonUserCode()> _
Private Sub InitializeComponent()
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
End Sub
Private thrownExceptionValue As New System.Exception("My Exception Message.")
Public Property ThrownException() As Exception
Get
Return thrownExceptionValue
End Get
Set(ByVal value As Exception)
thrownExceptionValue = value
End Set
End Property
Private throwActivity1 As ThrowActivity
End Class
適用於
ActivityBind(String)
以 ActivityBind 參數,初始化 name
類別的新執行個體。
public:
ActivityBind(System::String ^ name);
public ActivityBind (string name);
new System.Workflow.ComponentModel.ActivityBind : string -> System.Workflow.ComponentModel.ActivityBind
Public Sub New (name As String)
參數
適用於
ActivityBind(String, String)
以 ActivityBind 和 name
參數,初始化 path
類別的新執行個體。
public:
ActivityBind(System::String ^ name, System::String ^ path);
public ActivityBind (string name, string path);
new System.Workflow.ComponentModel.ActivityBind : string * string -> System.Workflow.ComponentModel.ActivityBind
Public Sub New (name As String, path As String)
參數
- path
- String
新 ActivityBind 的路徑。
範例
這個範例說明建立和使用 ActivityBind。
這個程式碼範例是 ThrowActivity.cs 檔案中<擲回活動 SDK>範例的一部分。 如需詳細資訊,請參閱 使用 ThrowActivity 活動。
public sealed partial class ThrowWorkflow : SequentialWorkflowActivity
{
[System.Diagnostics.DebuggerNonUserCode()]
private void InitializeComponent()
{
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;
}
private Exception thrownExceptionValue = new System.Exception("My Exception Message.");
public Exception ThrownException
{
get { return thrownExceptionValue; }
set { thrownExceptionValue = value; }
}
private ThrowActivity throwActivity1;
}
Partial Public NotInheritable Class ThrowWorkflow
Inherits SequentialWorkflowActivity
<System.Diagnostics.DebuggerNonUserCode()> _
Private Sub InitializeComponent()
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
End Sub
Private thrownExceptionValue As New System.Exception("My Exception Message.")
Public Property ThrownException() As Exception
Get
Return thrownExceptionValue
End Get
Set(ByVal value As Exception)
thrownExceptionValue = value
End Set
End Property
Private throwActivity1 As ThrowActivity
End Class