TraceListener.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,其中包含追蹤接聽程式的自訂屬性。

備註

繼承自 類別的 TraceListener 類別可以藉由覆 GetSupportedAttributes 寫 方法並傳回自定義屬性名稱的字元串陣列來新增自訂屬性。 屬性 Attributes 會識別應用程式組態檔中所參考的自定義屬性。 例如,在下列組態檔中, DelimitedListTraceListener 會參考自定義屬性 「delimiter」。 在這裡情況下,屬性會 Attributes 傳回包含 StringDictionary 字串 「delimiter」 的 。

<listeners>  
  <add name="delimitedListener"   
    type="System.Diagnostics.DelimitedListTraceListener"   
    delimiter=":"   
    initializeData="delimitedOutput.txt"   
    traceOutputOptions="ProcessId, DateTime" />  
  <remove name="Default" />  
</listeners>  

未列舉未參考的自定義屬性。 如需詳細資訊,請參閱 GetSupportedAttributes 方法。

適用於