Lenguaje

WebErrorEvent Constructores

Definición

Inicializa una nueva instancia de la clase WebErrorEvent.

Sobrecargas

Nombre Description
WebErrorEvent(String, Object, Int32, Exception)

Inicializa la WebErrorEvent clase mediante los parámetros proporcionados.

WebErrorEvent(String, Object, Int32, Int32, Exception)

Inicializa una nueva instancia de la WebErrorEvent clase mediante los parámetros proporcionados.

WebErrorEvent(String, Object, Int32, Exception)

Inicializa la WebErrorEvent clase mediante los parámetros proporcionados.

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

Parámetros

message
String

Descripción del evento.

eventSource
Object

Objeto que es el origen del evento.

eventCode
Int32

Código asociado al evento. Al implementar un evento personalizado, el código de evento debe ser mayor que WebExtendedBase.

exception
Exception

Exception Asociado al error.

Ejemplos

En el ejemplo de código siguiente se muestra cómo personalizar este constructor.

// Invoked in case of events identified 
// only by their event code.
public SampleWebErrorEvent(string msg, 
    object eventSource, int eventCode, Exception e)
    :
base(msg, eventSource, eventCode, e)
{
    // Perform custom initialization.
    eventInfo = new StringBuilder();
    eventInfo.Append(string.Format(
        "Event created at: ", EventTime.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.
     eventInfo = New StringBuilder()
     eventInfo.Append(String.Format( _
     "Event created at: ", EventTime.ToString()))
 End Sub

Comentarios

El WebErrorEvent constructor no está pensado para usarse directamente desde el código. Lo llama ASP.NET. Puede llamar al WebErrorEvent constructor al derivar de la WebErrorEvent clase .

Consulte también

Se aplica a

WebErrorEvent(String, Object, Int32, Int32, Exception)

Inicializa una nueva instancia de la WebErrorEvent clase mediante los parámetros proporcionados.

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

Parámetros

message
String

Descripción del evento.

eventSource
Object

Objeto que es el origen del evento.

eventCode
Int32

Código asociado al evento. Al implementar un evento personalizado, el código de evento debe ser mayor que WebExtendedBase.

eventDetailCode
Int32

Valor WebEventCodes que especifica el identificador detallado del evento.

exception
Exception

Exception Asociado al error.

Ejemplos

En el ejemplo de código siguiente se muestra cómo derivar de la WebErrorEvent clase para crear un evento personalizado.

// Invoked in case of events identified 
// by their event code.and 
// related event detailed code.
public SampleWebErrorEvent(string msg, 
    object eventSource, int eventCode, 
    int detailedCode, Exception e):
  base(msg, eventSource, 
    eventCode, detailedCode, e)
{
    // Perform custom initialization.
    eventInfo = new StringBuilder();
    eventInfo.Append(string.Format(
        "Event created at: ", EventTime.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.
     eventInfo = New StringBuilder()
     eventInfo.Append(String.Format( _
     "Event created at: ", EventTime.ToString()))
 End Sub

Comentarios

El WebErrorEvent constructor no está pensado para usarse directamente desde el código. Lo llama ASP.NET. Puede llamar al WebErrorEvent constructor al derivar de la WebErrorEvent clase .

Consulte también

Se aplica a