WebBaseEvent Konstruktory
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Inicjuje nowe wystąpienie klasy WebBaseEvent.
Przeciążenia
WebBaseEvent(String, Object, Int32) |
Inicjuje WebBaseEvent nowe wystąpienie klasy przy użyciu podanych parametrów. |
WebBaseEvent(String, Object, Int32, Int32) |
Inicjuje WebBaseEvent nowe wystąpienie klasy przy użyciu podanych parametrów. |
WebBaseEvent(String, Object, Int32)
Inicjuje WebBaseEvent nowe wystąpienie klasy przy użyciu podanych parametrów.
protected public:
WebBaseEvent(System::String ^ message, System::Object ^ eventSource, int eventCode);
protected internal WebBaseEvent (string message, object eventSource, int eventCode);
new System.Web.Management.WebBaseEvent : string * obj * int -> System.Web.Management.WebBaseEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer)
Parametry
- message
- String
Opis zdarzenia.
- eventSource
- Object
Obiekt, który wzbudził zdarzenie.
- eventCode
- Int32
Kod skojarzony ze zdarzeniem. Podczas implementowania zdarzenia niestandardowego kod zdarzenia musi być większy niż WebExtendedBase.
Przykłady
W poniższym przykładzie kodu pokazano, jak używać tego konstruktora.
// Invoked in case of events identified only by
// their event code.
public SampleWebBaseEvent(string msg,
object eventSource, int eventCode):
base(msg, eventSource, eventCode)
{
// Perform custom initialization.
customCreatedMsg =
string.Format("Event created at: {0}",
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)
MyBase.New(msg, eventSource, eventCode)
' 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. Nigdy nie użyjesz go do utworzenia wystąpienia WebBaseEvent klasy, ale możesz wywołać ten konstruktor podczas implementowania własnego typu zdarzenia dziedziczonego z tej klasy.
Zobacz też
Dotyczy
WebBaseEvent(String, Object, Int32, Int32)
Inicjuje WebBaseEvent nowe wystąpienie klasy przy użyciu podanych parametrów.
protected public:
WebBaseEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, int eventDetailCode);
protected internal WebBaseEvent (string message, object eventSource, int eventCode, int eventDetailCode);
new System.Web.Management.WebBaseEvent : string * obj * int * int -> System.Web.Management.WebBaseEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, eventDetailCode As Integer)
Parametry
- message
- String
Opis zgłoszonego zdarzenia.
- eventSource
- Object
Obiekt, który wzbudził zdarzenie.
- eventCode
- Int32
Kod skojarzony ze zdarzeniem. Podczas implementowania zdarzenia niestandardowego kod zdarzenia musi być większy niż WebExtendedBase.
- eventDetailCode
- Int32
Wartość WebEventCodes określająca szczegółowy identyfikator zdarzenia.
Przykłady
W poniższym przykładzie kodu pokazano, jak używać tego konstruktora.
// Invoked in case of events identified by their
// event code.and related event detailed code.
public SampleWebBaseEvent(string msg, object eventSource,
int eventCode, int eventDetailCode):
base(msg, eventSource, eventCode, eventDetailCode)
{
// Perform custom initialization.
customCreatedMsg =
string.Format("Event created at: {0}",
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 eventDetailCode As Integer)
MyBase.New(msg, eventSource, _
eventCode, eventDetailCode)
' 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. Nigdy nie użyjesz go do utworzenia wystąpienia WebBaseEvent klasy, ale możesz wywołać ten konstruktor podczas implementowania własnego typu zdarzenia dziedziczonego z tej klasy.