Language

WebErrorEvent コンストラクター

定義

WebErrorEvent クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
WebErrorEvent(String, Object, Int32, Exception)

指定されたパラメーターを使用して、 WebErrorEvent クラスを初期化します。

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

指定されたパラメーターを使用して、 WebErrorEvent クラスの新しいインスタンスを初期化します。

WebErrorEvent(String, Object, Int32, Exception)

指定されたパラメーターを使用して、 WebErrorEvent クラスを初期化します。

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)

パラメーター

message
String

イベントの説明。

eventSource
Object

イベントのソースであるオブジェクト。

eventCode
Int32

イベントに関連付けられているコード。 カスタム イベントを実装する場合、イベント コードは WebExtendedBaseより大きい必要があります。

exception
Exception

エラーに関連付けられている Exception 。

例

次のコード例は、このコンストラクターをカスタマイズする方法を示しています。

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

注釈

WebErrorEvent コンストラクターは、コードから直接使用するためのものではありません。 ASP.NET によって呼び出されます。 WebErrorEvent クラスから派生するときに、WebErrorEvent コンストラクターを呼び出すことができます。

こちらもご覧ください

適用対象

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

指定されたパラメーターを使用して、 WebErrorEvent クラスの新しいインスタンスを初期化します。

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)

パラメーター

message
String

イベントの説明。

eventSource
Object

イベントのソースであるオブジェクト。

eventCode
Int32

イベントに関連付けられているコード。 カスタム イベントを実装する場合、イベント コードは WebExtendedBaseより大きい必要があります。

eventDetailCode
Int32

イベントの詳細な識別子を指定する WebEventCodes 値。

exception
Exception

エラーに関連付けられている Exception 。

例

次のコード例は、 WebErrorEvent クラスから派生してカスタム イベントを作成する方法を示しています。

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

注釈

WebErrorEvent コンストラクターは、コードから直接使用するためのものではありません。 ASP.NET によって呼び出されます。 WebErrorEvent クラスから派生するときに、WebErrorEvent コンストラクターを呼び出すことができます。

こちらもご覧ください

適用対象