Switch.Attributes プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
アプリケーション構成ファイルで定義されているカスタム スイッチ属性を取得します。
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 メソッドをオーバーライドし、カスタム属性名の文字列配列を返すことによって、カスタム属性を追加できます。