ThrowActivity 생성자

정의

ThrowActivity 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ThrowActivity class.

오버로드

ThrowActivity()

ThrowActivity 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ThrowActivity class.

ThrowActivity(String)

ThrowActivity 클래스의 새 인스턴스를 초기화하고 해당 이름을 초기화합니다.Initializes a new instance of the ThrowActivity class, and initializes its name.

ThrowActivity()

ThrowActivity 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ThrowActivity class.

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

예제

다음 코드에서는 워크플로에 단일 throw 활동을 사용하여 예외 처리를 구현하는 방법을 보여 줍니다.The following code shows the use of a single throw activity in a workflow to implement exception handling. 이 예제는 생성자 호출을 포함합니다.This example includes invoking the constructor. 이 코드 예제는 ThrowWorkflow.cs 파일에 있는 Throw SDK 샘플의 일부입니다.This code example is part of the Throw SDK sample and is from the ThrowWorkflow.cs file. 자세한 내용은 Throw를 사용 하 여입니다.For more information, see Using Throw.

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

ThrowActivity(String)

ThrowActivity 클래스의 새 인스턴스를 초기화하고 해당 이름을 초기화합니다.Initializes a new instance of the ThrowActivity class, and initializes its name.

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

매개 변수

name
String

활동의 사용자 정의 이름입니다.The user-defined name of the activity.

예외

identifier이 null 참조(Visual Basic의 경우 Nothing)인 경우identifier is a null reference (Nothing in Visual Basic).

적용 대상