次の方法で共有


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

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

// 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 メソッドをオーバーライドし、カスタム属性名の文字列配列を返すことによって、カスタム属性を追加できます。

適用対象