SendActivity.BeforeSend 事件

定义

SendActivity 活动将消息发送到服务之前发生。

public:
 event EventHandler<System::Workflow::Activities::SendActivityEventArgs ^> ^ BeforeSend;
[System.ComponentModel.Browsable(true)]
public event EventHandler<System.Workflow.Activities.SendActivityEventArgs> BeforeSend;
[<System.ComponentModel.Browsable(true)>]
member this.BeforeSend : EventHandler<System.Workflow.Activities.SendActivityEventArgs> 
Public Custom Event BeforeSend As EventHandler(Of SendActivityEventArgs) 

事件类型

属性

示例

下面的示例演示如何使用 BeforeSend 事件。 此示例从 Conversations SDK 示例改写而来。

[System.Diagnostics.DebuggerNonUserCode]
private void InitializeComponent()
{
    SendActivity sendActivity1 = new SendActivity();
    sendActivity1.BeforeSend += new EventHandler<SendActivityEventArgs>(sendActivity1_BeforeSend);
}

void sendActivity1_BeforeSend(object sender, SendActivityEventArgs e)
{
    Console.WriteLine("SendActivity1 BeforeSend event fired.");
}

void sendActivity1_AfterResponse(object sender, SendActivityEventArgs e)
{
    Console.WriteLine("SendActivity1 AfterResponse event fired.");
}

注解

可以使用与此事件关联的事件处理程序为所调用的服务操作设置参数值。

注意

无法在此事件处理程序中设置 SendActivity 的上下文。

适用于