TraceContextEventArgs クラス
アセンブリ: System.Web (system.web.dll 内)


TraceContextEventArgs クラスは TraceContext クラスによって使用され、HTTP の要求処理中にすべてのトレース情報が収集された後、トレース レコードにアクセスできるようにします。TraceFinished イベントを処理するイベント ハンドラ デリゲートを追加することによって、レコードを処理したり、レコードを独自のデータ ストアに記録したりできます。また、レコードをプロファイル ツールに入力として提供することもできます。

TraceContextEventHandler デリゲートを登録して TraceFinished イベントを処理する方法を次のコード例に示します。この例では、OnTraceFinished メソッドが TraceRecords プロパティを通じて TraceContextRecord オブジェクトのコレクションにアクセスし、このコレクションを反復処理して、応答ストリームに書き込んでいます。
<%@ Page language="VB" Trace="true" %> <script runat="server"> ' The Page_Load method. Private Sub Page_Load(sender As Object, e As EventArgs) ' Register a handler for the TraceFinished event. AddHandler Trace.TraceFinished, AddressOf OnTraceFinished ' Write a trace message. Trace.Write("Web Forms Infrastructure Methods", "USERMESSAGE: Page_Load complete.") End Sub ' Page_Load ' A TraceContextEventHandler for the TraceFinished event. Private Sub OnTraceFinished(sender As Object, e As TraceContextEventArgs) Dim r As TraceContextRecord Dim o As Object ' Iterate through the collection of trace records and write ' them to the response stream. For Each o In e.TraceRecords r = CType(o, TraceContextRecord) Response.Write(String.Format("trace message: {0} <BR>", r.Message)) Next End Sub ' OnTraceFinished </script>
<%@ Page language="c#" Trace="true" %> <script runat="server"> void Page_Load(object sender, EventArgs e) { // Register a handler for the TraceFinished event. Trace.TraceFinished += new TraceContextEventHandler(this.OnTraceFinished); // Write a trace message. Trace.Write("Web Forms Infrastructure Methods", "USERMESSAGE: Page_Load complete."); } // A TraceContextEventHandler for the TraceFinished event. void OnTraceFinished(object sender, TraceContextEventArgs e) { TraceContextRecord r = null; // Iterate through the collection of trace records and write // them to the response stream. foreach(object o in e.TraceRecords) { r = (TraceContextRecord)o; Response.Write(String.Format("trace message: {0} <BR>", r.Message)); } } </script>


System.EventArgs
System.Web.TraceContextEventArgs


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TraceContextEventArgs コンストラクタ
アセンブリ: System.Web (system.web.dll 内)


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


TraceContextEventArgs プロパティ
TraceContextEventArgs メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

TraceContextEventArgs メンバ
TraceFinished イベントを処理するメソッドにトレース レコードのコレクションを提供します。このクラスは継承できません。
TraceContextEventArgs データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- TraceContextEventArgsのページへのリンク