WebEventProvider.ProcessEvent(WebBaseEvent) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
處理傳遞給提供者的事件。
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 健康情況監視呼叫以開始處理事件的方法。