Activity.RaiseEvent(DependencyProperty, Object, EventArgs) 메서드

정의

지정된 종속성 속성과 연결된 Event를 발생시킵니다.

protected internal void RaiseEvent (System.Workflow.ComponentModel.DependencyProperty dependencyEvent, object sender, EventArgs e);

매개 변수

dependencyEvent
DependencyProperty

DependencyProperty와 연결된 Event입니다.

sender
Object

ObjectEvent 소스입니다.

e
EventArgs

EventArgs와 연결된 Event입니다.

예제

다음 코드는 이 메서드를 호출하여 로 정의된 DependencyProperty이벤트를 발생합니다.

이 코드 예제는 전자 메일 보내기 작업 샘플의 일부이며 SendEmailActivity.cs 파일에서 가져옵니다. 자세한 내용은 전자 메일 보내기 작업 샘플을 참조하세요.

protected override ActivityExecutionStatus Execute(ActivityExecutionContext context)
{
    try
    {
        // Raise the SendingEmail event to the parent workflow or activity
        base.RaiseEvent(SendEmailActivity.SendingEmailEvent, this, EventArgs.Empty);

        // Send the email now
        this.SendEmailUsingSmtp();

        // Raise the SentEmail event to the parent workflow or activity
        base.RaiseEvent(SendEmailActivity.SentEmailEvent, this, EventArgs.Empty);

        // Return the closed status indicating that this activity is complete.
        return ActivityExecutionStatus.Closed;
    }
    catch
    {
        // An unhandled exception occurred.  Throw it back to the WorkflowRuntime.
        throw;
    }
}

적용 대상