Activity.RaiseEvent(DependencyProperty, Object, EventArgs) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Raises an Event associated with the specified dependency property.
protected public:
void RaiseEvent(System::Workflow::ComponentModel::DependencyProperty ^ dependencyEvent, System::Object ^ sender, EventArgs ^ e);
protected internal void RaiseEvent (System.Workflow.ComponentModel.DependencyProperty dependencyEvent, object sender, EventArgs e);
member this.RaiseEvent : System.Workflow.ComponentModel.DependencyProperty * obj * EventArgs -> unit
Protected Friend Sub RaiseEvent (dependencyEvent As DependencyProperty, sender As Object, e As EventArgs)
Parameters
- dependencyEvent
- DependencyProperty
The DependencyProperty associated with this Event.
Examples
The following code invokes this method to raise an event that is defined as a DependencyProperty.
This code example is part of the Send Email Activity sample and is from the SendEmailActivity.cs file. For more information, see Send Email Activity Sample
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;
}
}
Protected Overrides Function Execute(ByVal context As ActivityExecutionContext) As ActivityExecutionStatus
Try
' Raise the SendingEmail event to the parent workflow or activity
MyBase.RaiseEvent(SendEmailActivity.SendingEmailEvent, Me, EventArgs.Empty)
' Send the email now
Me.SendEmailUsingSmtp()
' Raise the SentEmail event to the parent workflow or activity
MyBase.RaiseEvent(SendEmailActivity.SentEmailEvent, Me, 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
End Try
End Function
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET