WebEventProvider.ProcessEvent(WebBaseEvent) 方法

定义

处理传递给提供程序的事件。

public:
 abstract void ProcessEvent(System::Web::Management::WebBaseEvent ^ raisedEvent);
public abstract void ProcessEvent (System.Web.Management.WebBaseEvent raisedEvent);
abstract member ProcessEvent : System.Web.Management.WebBaseEvent -> unit
Public MustOverride Sub ProcessEvent (raisedEvent As WebBaseEvent)

参数

raisedEvent
WebBaseEvent

要处理的 WebBaseEvent 对象。

示例

下面的代码示例演示如何实现 ProcessEvent 方法。 此方法将事件的自定义字符串表示形式追加到特定的日志文件中。


// Process the event that has been raised.
public override void ProcessEvent(WebBaseEvent raisedEvent)
{ 
    if (msgCounter < maxMsgNumber)
    {
        // Buffer the event information.
        msgBuffer.Enqueue(raisedEvent);
        // Increment the message counter.
        msgCounter += 1;
    }
    else
    {
        // Flush the buffer.
        Flush();
    }
}
' Process the event that has been raised.
Public Overrides Sub ProcessEvent( _
ByVal raisedEvent As WebBaseEvent)

    If msgCounter < maxMsgNumber Then
        ' Buffer the event information.
        msgBuffer.Enqueue(raisedEvent)
        ' Increment the message counter.
        msgCounter += 1
    Else
        ' Flush the buffer.
        Flush()
    End If

End Sub

注解

这是 ASP.NET 运行状况监视调用以开始处理事件的方法。

适用于