TraceListener.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.StringDictionaryPublic 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 方法。