WebErrorEvent 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 WebErrorEvent classe.
Sobrecargas
| Name | Description |
|---|---|
| WebErrorEvent(String, Object, Int32, Exception) |
Inicializa a WebErrorEvent classe usando os parâmetros fornecidos. |
| WebErrorEvent(String, Object, Int32, Int32, Exception) |
Inicializa uma nova instância da WebErrorEvent classe usando os parâmetros fornecidos. |
WebErrorEvent(String, Object, Int32, Exception)
Inicializa a WebErrorEvent classe usando os parâmetros fornecidos.
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
A descrição do 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 seguinte exemplo de código mostra como personalizar este construtor.
// 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
Observações
O WebErrorEvent construtor não foi concebido para ser usado diretamente a partir do seu código. É chamada por ASP.NET. Podes chamar o WebErrorEvent construtor ao derivar da WebErrorEvent classe.
Ver também
Aplica-se a
WebErrorEvent(String, Object, Int32, Int32, Exception)
Inicializa uma nova instância da WebErrorEvent classe usando os parâmetros fornecidos.
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
A descrição do 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 derivar a partir da WebErrorEvent classe para criar um 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
Observações
O WebErrorEvent construtor não foi concebido para ser usado diretamente a partir do seu código. É chamada por ASP.NET. Podes chamar o WebErrorEvent construtor ao derivar da WebErrorEvent classe.