This documentation is archived and is not being maintained.

Activity.RaiseEvent Method

Raises an Event associated with the specified dependency property.

Namespace: System.Workflow.ComponentModel
Assembly: System.Workflow.ComponentModel (in system.workflow.componentmodel.dll)

protected internal void RaiseEvent (
	DependencyProperty dependencyEvent,
	Object sender,
	EventArgs e
)
protected void RaiseEvent (
	DependencyProperty dependencyEvent, 
	Object sender, 
	EventArgs e
)
protected internal function RaiseEvent (
	dependencyEvent : DependencyProperty, 
	sender : Object, 
	e : EventArgs
)
Not applicable.

Parameters

dependencyEvent

The DependencyProperty associated with this Event.

sender

The Object source of the Event.

e

The EventArgs associated with the Event.

The following code invokes this method to raise an event which has been defined earlier as a DependencyProperty.

This code example is part of the Send E-mail SDK sample and is from the SendEmailActivity.cs file. For more information, see Send E-mail 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);

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


Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: