Edit

Share via


WebBaseErrorEvent Constructors

Definition

Initializes a new instance of the WebBaseErrorEvent class.

Overloads

WebBaseErrorEvent(String, Object, Int32, Exception)

Initializes a new instance of the WebBaseErrorEvent class.

WebBaseErrorEvent(String, Object, Int32, Int32, Exception)

Initializes a new instance of the WebBaseErrorEvent class.

WebBaseErrorEvent(String, Object, Int32, Exception)

Initializes a new instance of the WebBaseErrorEvent class.

protected public:
 WebBaseErrorEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, Exception ^ e);
protected internal WebBaseErrorEvent (string message, object eventSource, int eventCode, Exception e);
new System.Web.Management.WebBaseErrorEvent : string * obj * int * Exception -> System.Web.Management.WebBaseErrorEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, e As Exception)

Parameters

message
String

The event description.

eventSource
Object

The object that is the source of the event.

eventCode
Int32

The code associated with the event. When you implement a custom event, the event code must be greater than WebExtendedBase.

e
Exception

The Exception associated with the error.

Examples

The following code example shows how to call this constructor from a constructor for the SampleWebBaseErrorEvent class, a class that derives from the WebBaseErrorEvent class.

// Invoked in case of events identified only by their event code.
public SampleWebBaseErrorEvent(string msg, 
    object eventSource, int eventCode, Exception e):
  base(msg, eventSource, eventCode, e)
{
    // Perform custom initialization.
    customCreatedMsg =
      string.Format("Event created at: {0}", 
      DateTime.Now.TimeOfDay.ToString());
}
' Invoked in case of events identified only by their event code.
Public Sub New(ByVal msg As String, ByVal eventSource As Object, _
ByVal eventCode As Integer, ByVal e As Exception)
    MyBase.New(msg, eventSource, eventCode, e)
    ' Perform custom initialization.
    customCreatedMsg = String.Format("Event created at: {0}", _
    DateTime.Now.TimeOfDay.ToString())

End Sub

Remarks

This constructor is used internally by the ASP.NET health-monitoring system. You can call this constructor when implementing your own event type that inherits from this class.

See also

Applies to

WebBaseErrorEvent(String, Object, Int32, Int32, Exception)

Initializes a new instance of the WebBaseErrorEvent class.

protected public:
 WebBaseErrorEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, int eventDetailCode, Exception ^ e);
protected internal WebBaseErrorEvent (string message, object eventSource, int eventCode, int eventDetailCode, Exception e);
new System.Web.Management.WebBaseErrorEvent : string * obj * int * int * Exception -> System.Web.Management.WebBaseErrorEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, eventDetailCode As Integer, e As Exception)

Parameters

message
String

The event description.

eventSource
Object

The object that is the source of the event.

eventCode
Int32

The code associated with the event. When you implement a custom event, the event code must be greater than WebExtendedBase.

eventDetailCode
Int32

The detailed identifier for the event.

e
Exception

The Exception associated with the error.

Examples

The following code example shows how to call this constructor from a constructor for the SampleWebBaseErrorEvent class, a class that derives from the WebBaseErrorEvent class.

// Invoked in case of events identified by their event code and 
// related event detailed code.
public SampleWebBaseErrorEvent(string msg, object eventSource, 
    int eventCode, int detailedCode, Exception e):
  base(msg, eventSource, eventCode, detailedCode, e)
{
    // Perform custom initialization.
    customCreatedMsg =
      string.Format("Event created at: {0}", 
      DateTime.Now.TimeOfDay.ToString());
}
' Invoked in case of events identified by their event code and 
' related event detailed code.
Public Sub New(ByVal msg As String, ByVal eventSource As Object, _
ByVal eventCode As Integer, ByVal detailedCode As Integer, _
ByVal e As Exception)
    MyBase.New(msg, eventSource, eventCode, detailedCode, e)
    ' Perform custom initialization.
    customCreatedMsg = String.Format("Event created at: {0}", _
    DateTime.Now.TimeOfDay.ToString())

End Sub

Remarks

This constructor is used internally by the ASP.NET health-monitoring system. You can call this constructor when implementing your own event type that inherits from this class.

See also

Applies to