語言

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 健康監控呼叫以開始處理事件的方法。

適用於