BufferedWebEventProvider.ProcessEvent Method (WebBaseEvent)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Processes the event passed to the provider.

Namespace:   System.Web.Management
Assembly:  System.Web (in System.Web.dll)

public override void ProcessEvent(
	WebBaseEvent eventRaised
)

Parameters

eventRaised
Type: System.Web.Management.WebBaseEvent

The WebBaseEvent object to process.

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.

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);
    }
}

.NET Framework
Available since 2.0
Return to top
Show: