다음을 통해 공유


ThrowActivity.FaultType 속성

정의

ThrowActivity에서 throw되어야 하는 예외 형식을 가져오거나 설정합니다.

public:
 property Type ^ FaultType { Type ^ get(); void set(Type ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Workflow.ComponentModel.ThrowActivity+FaultTypeConverter))]
public Type FaultType { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Workflow.ComponentModel.ThrowActivity+FaultTypeConverter))>]
member this.FaultType : Type with get, set
Public Property FaultType As Type

속성 값

Type

이 인스턴스와 연결된 오류를 나타내는 형식입니다.

특성

예제

다음 코드에서는 워크플로에 단일 throw 활동을 사용하여 예외 처리를 구현하는 방법을 보여 줍니다. 이 예제는 FaultTypenull로 설정하는 방법을 보여 줍니다. 이 코드 예제는 ThrowWorkflow.cs 파일에 있는 Throw SDK 샘플의 일부입니다. 자세한 내용은 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

적용 대상