WebApplicationLifetimeEvent Construtores
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da WebApplicationLifetimeEvent classe.
Sobrecargas
| Name | Description |
|---|---|
| WebApplicationLifetimeEvent(String, Object, Int32) |
Inicializa a WebApplicationLifetimeEvent classe usando os parâmetros fornecidos. |
| WebApplicationLifetimeEvent(String, Object, Int32, Int32) |
Inicializa a WebApplicationLifetimeEvent classe usando os parâmetros fornecidos. |
WebApplicationLifetimeEvent(String, Object, Int32)
Inicializa a WebApplicationLifetimeEvent classe usando os parâmetros fornecidos.
protected public:
WebApplicationLifetimeEvent(System::String ^ message, System::Object ^ eventSource, int eventCode);
protected internal WebApplicationLifetimeEvent(string message, object eventSource, int eventCode);
new System.Web.Management.WebApplicationLifetimeEvent : string * obj * int -> System.Web.Management.WebApplicationLifetimeEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer)
Parâmetros
- message
- String
A mensagem associada ao evento.
- eventSource
- Object
O objeto que é a fonte do evento.
- eventCode
- Int32
O código associado ao evento. Quando implementa um evento personalizado, o código do evento deve ser maior que WebExtendedBase.
Exemplos
O exemplo de código seguinte mostra como usar o WebApplicationLifetimeEvent num evento de saúde personalizado ASP.NET. Este exemplo de código destina-se principalmente a mostrar a sintaxe correta a utilizar.
// Invoked in case of events identified only by
// their event code.
public SampleWebApplicationLifetimeEvent(string msg,
object eventSource, int eventCode):
base(msg, eventSource, eventCode)
{
// 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)
MyBase.New(msg, eventSource, eventCode)
' Perform custom initialization.
customCreatedMsg = _
String.Format("Event created at: {0}", _
DateTime.Now.TimeOfDay.ToString())
End Sub
Observações
Este construtor é utilizado internamente pelo sistema de monitorização de saúde ASP.NET. Nunca o usarás para criar uma instância da WebApplicationLifetimeEvent classe, mas podes chamar este construtor ao implementar o teu próprio tipo de evento que herda desta classe.
Note
O WebApplicationLifetimeEvent construtor não foi concebido para ser usado diretamente a partir do seu código. É chamada por ASP.NET. Podes chamar o WebApplicationLifetimeEvent construtor ao derivar da WebApplicationLifetimeEvent classe.
Ver também
Aplica-se a
WebApplicationLifetimeEvent(String, Object, Int32, Int32)
Inicializa a WebApplicationLifetimeEvent classe usando os parâmetros fornecidos.
protected public:
WebApplicationLifetimeEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, int eventDetailCode);
protected internal WebApplicationLifetimeEvent(string message, object eventSource, int eventCode, int eventDetailCode);
new System.Web.Management.WebApplicationLifetimeEvent : string * obj * int * int -> System.Web.Management.WebApplicationLifetimeEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, eventDetailCode As Integer)
Parâmetros
- message
- String
A mensagem associada ao evento.
- eventSource
- Object
O objeto que é a fonte do evento.
- eventCode
- Int32
O código associado ao evento. Quando implementa um evento personalizado, o código do evento deve ser maior que WebExtendedBase.
- eventDetailCode
- Int32
O WebEventCodes valor que especifica o identificador detalhado do evento.
Exemplos
O exemplo de código seguinte mostra como usar o WebApplicationLifetimeEvent num evento de saúde personalizado ASP.NET. Este exemplo de código destina-se principalmente a mostrar a sintaxe correta a utilizar.
// Invoked in case of events identified by their
// event code.and related event detailed code.
public SampleWebApplicationLifetimeEvent(string msg,
object eventSource, int eventCode,
int eventDetailCode):
base(msg, eventSource, eventCode, eventDetailCode)
{
// 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 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
Observações
Este construtor é utilizado internamente pelo sistema de monitorização de saúde ASP.NET. Nunca o usarás para criar uma instância da WebApplicationLifetimeEvent classe, mas podes chamar este construtor ao implementar o teu próprio tipo de evento que herda desta classe.
Note
O WebApplicationLifetimeEvent construtor não foi concebido para ser usado diretamente a partir do seu código. É chamada por ASP.NET. Podes chamar o WebApplicationLifetimeEvent construtor ao derivar da WebApplicationLifetimeEvent classe.