Switch.Attributes プロパティ

定義

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

public:
 property System::Collections::Specialized::StringDictionary ^ Attributes { System::Collections::Specialized::StringDictionary ^ get(); };
public System.Collections.Specialized.StringDictionary Attributes { get; }
member this.Attributes : System.Collections.Specialized.StringDictionary
Public ReadOnly Property Attributes As StringDictionary

プロパティ値

StringDictionary

トレース スイッチの大文字小文字を区別しないカスタム属性を格納している StringDictionary

次のコード サンプルは、カスタム スイッチの認識されない属性を表示する方法を示しています。

// Get the custom attributes for the trace source switch.
foreach (DictionaryEntry de in ts.Switch.Attributes)
    Console.WriteLine(de.Key + "  " + de.Value);
' Get the custom attributes for the trace source switch.

For Each de In ts.Switch.Attributes
    Console.WriteLine(de.Key + "  " + de.Value)
Next de

注釈

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

適用対象