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 方法並傳回自定義屬性名稱的字串陣列來新增自定義屬性。

適用於