Udostępnij za pośrednictwem


WebBaseErrorEvent Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy WebBaseErrorEvent.

Przeciążenia

WebBaseErrorEvent(String, Object, Int32, Exception)

Inicjuje nowe wystąpienie klasy WebBaseErrorEvent.

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

Inicjuje nowe wystąpienie klasy WebBaseErrorEvent.

WebBaseErrorEvent(String, Object, Int32, Exception)

Inicjuje nowe wystąpienie klasy WebBaseErrorEvent.

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)

Parametry

message
String

Opis zdarzenia.

eventSource
Object

Obiekt, który jest źródłem zdarzenia.

eventCode
Int32

Kod skojarzony ze zdarzeniem. Podczas implementowania zdarzenia niestandardowego kod zdarzenia musi być większy niż WebExtendedBase.

e
Exception

Skojarzony Exception z błędem.

Przykłady

W poniższym przykładzie kodu pokazano, jak wywołać ten konstruktor z konstruktora klasy SampleWebBaseErrorEvent , klasę, która pochodzi z WebBaseErrorEvent klasy.

// 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

Uwagi

Ten konstruktor jest używany wewnętrznie przez system monitorowania kondycji ASP.NET. Ten konstruktor można wywołać podczas implementowania własnego typu zdarzenia dziedziczonego z tej klasy.

Zobacz też

Dotyczy

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

Inicjuje nowe wystąpienie klasy WebBaseErrorEvent.

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)

Parametry

message
String

Opis zdarzenia.

eventSource
Object

Obiekt, który jest źródłem zdarzenia.

eventCode
Int32

Kod skojarzony ze zdarzeniem. Podczas implementowania zdarzenia niestandardowego kod zdarzenia musi być większy niż WebExtendedBase.

eventDetailCode
Int32

Szczegółowy identyfikator zdarzenia.

e
Exception

Skojarzony Exception z błędem.

Przykłady

W poniższym przykładzie kodu pokazano, jak wywołać ten konstruktor z konstruktora klasy SampleWebBaseErrorEvent , klasę, która pochodzi z WebBaseErrorEvent klasy.

// 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

Uwagi

Ten konstruktor jest używany wewnętrznie przez system monitorowania kondycji ASP.NET. Ten konstruktor można wywołać podczas implementowania własnego typu zdarzenia dziedziczonego z tej klasy.

Zobacz też

Dotyczy