BufferedWebEventProvider.ProcessEvent(WebBaseEvent) Method

Definition

Processes the event passed to the provider.

public:
 override void ProcessEvent(System::Web::Management::WebBaseEvent ^ eventRaised);
public override void ProcessEvent (System.Web.Management.WebBaseEvent eventRaised);
override this.ProcessEvent : System.Web.Management.WebBaseEvent -> unit
Public Overrides Sub ProcessEvent (eventRaised As WebBaseEvent)

Parameters

eventRaised
WebBaseEvent

The WebBaseEvent object to process.

Examples

The following code example shows how to implement the ProcessEvent method.


// Processes the incoming events.
// This method performs custom processing and, 
// if buffering is enabled, it calls the 
// base.ProcessEvent to buffer the event
// information.
public override void ProcessEvent(
    WebBaseEvent eventRaised)
{

    if (UseBuffering)
    {
        // Buffering enabled, call the 
        // base event to buffer event information.
        base.ProcessEvent(eventRaised);
    }
    else
    {
        // Buffering disabled, store the 
        // current event now.
        customInfo.AppendLine(
            "*** Buffering disabled ***");
        customInfo.AppendLine(
            eventRaised.ToString());
        // Store the information in the specified file.
        StoreToFile(customInfo, 
            logFilePath, FileMode.Append);
    }
}
' Processes the incoming events.
 ' This method performs custom 
 ' processing and, if buffering is 
 ' enabled, it calls the base.ProcessEvent
 ' to buffer the event information.
 Public Overrides Sub ProcessEvent( _
 ByVal eventRaised As WebBaseEvent)

     If UseBuffering Then
         ' Buffering enabled, call the base event to
         ' buffer event information.
         MyBase.ProcessEvent(eventRaised)
     Else
         ' Buffering disabled, store the current event
         ' now.
         customInfo.AppendLine("*** Buffering disabled ***")
         customInfo.AppendLine(eventRaised.ToString())
         ' Store the information in the specified file.
         StoreToFile(customInfo, _
         logFilePath, FileMode.Append)
     End If
 End Sub

Remarks

This is the method that ASP.NET health monitoring calls to start the processing of the event. If buffering is enabled, the event information is buffered; otherwise, it is dispatched to the current logging mechanism.

Applies to