다음을 통해 공유


ReplicatorActivity.ChildInitialized 이벤트

정의

자식 활동이 초기화되면 바로 발생합니다.

public:
 event EventHandler<System::Workflow::Activities::ReplicatorChildEventArgs ^> ^ ChildInitialized;
public event EventHandler<System.Workflow.Activities.ReplicatorChildEventArgs> ChildInitialized;
member this.ChildInitialized : EventHandler<System.Workflow.Activities.ReplicatorChildEventArgs> 
Public Custom Event ChildInitialized As EventHandler(Of ReplicatorChildEventArgs) 

이벤트 유형

예제

다음 코드 예제에서는 ChildInitialized 이벤트 값을 설정하는 방법을 보여 줍니다. 이 코드 예제는 SimpleReplicatorWorkflow.Designer.cs 파일에 있는 Replicator SDK 샘플의 일부입니다. 자세한 내용은 복제기를 사용 하 여입니다.

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

설명

구독하는 경우에는 Children 컬렉션의 항목에 대해 자식 활동의 인스턴스가 만들어질 때마다 이 이벤트가 발생합니다. Children 컬렉션은 ReplicatorChildEventArgs 이벤트 처리기의 Initialized를 통해 설정됩니다. Activity가 자식의 값을 설정하도록 자식 ReplicatorActivity 인스턴스는 호출을 통해 전달됩니다. InstanceData 컬렉션의 관련 Children 개체도 같이 전달됩니다.

적용 대상

추가 정보