TraceSource.Attributes プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TraceSource.Attributes プロパティの意味・解説 

TraceSource.Attributes プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

アプリケーション構成ファイル定義されているカスタム スイッチ属性取得します

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

Dim instance As TraceSource
Dim value As StringDictionary

value = instance.Attributes
public StringDictionary Attributes { get; }
public:
property StringDictionary^ Attributes {
    StringDictionary^ get ();
}
/** @property */
public StringDictionary get_Attributes ()
public function get Attributes
 () : StringDictionary

プロパティ
トレース スイッチカスタム属性格納している StringDictionary。

解説解説

Attributes プロパティは、アプリケーション構成ファイル参照されるカスタム属性識別します。参照されないカスタム属性列挙されません。TraceSource クラスから継承されクラスカスタム属性追加するには、Switch.GetSupportedAttributes メソッドオーバーライドしてカスタム属性名の文字列配列返します

カスタム属性 SecondTraceSourceAttribute指定するトレース ソース要素の例を次に示します

<sources>
  <source name="TraceTest" switchName="TestSourceSwitch" 
    switchType="Testing.MySourceSwitch, TraceSample" 
    SecondTraceSourceAttribute="two">
  </source>
</sources>
使用例使用例

TraceSourceカスタム属性表示する方法次のコード例示します。このコード例は、TraceSource クラストピック取り上げているコード例一部分です。

' Get the custom attributes for the TraceSource.
Console.WriteLine("Number of custom trace source attributes =
 " + ts.Attributes.Count)
Dim de As DictionaryEntry
For Each de In  ts.Attributes
    Console.WriteLine("Custom trace source attribute = "
 + de.Key + "  " + de.Value)
Next de
// Get the custom attributes for the TraceSource.
Console.WriteLine("Number of custom trace source attributes = "
    + ts.Attributes.Count);
foreach (DictionaryEntry de in ts.Attributes)
    Console.WriteLine("Custom trace source attribute = "
        + de.Key + "  " + de.Value);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からTraceSource.Attributes プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTraceSource.Attributes プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTraceSource.Attributes プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

TraceSource.Attributes プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TraceSource.Attributes プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS