TraceListener.Attributes Propriété

Définition

Obtient les attributs d'écouteur de trace personnalisés définis dans le fichier de configuration de l'application.

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

Valeur de propriété

StringDictionary qui contient les attributs personnalisés pour l'écouteur de trace.

Remarques

Les classes qui héritent de la TraceListener classe peuvent ajouter des attributs personnalisés en remplaçant la GetSupportedAttributes méthode et en retournant un tableau de chaînes de noms d’attributs personnalisés. La Attributes propriété identifie les attributs personnalisés référencés dans le fichier de configuration de l’application. Par exemple, dans l’extrait de fichier de configuration suivant, l’attribut DelimitedListTraceListener personnalisé « délimiteur » est référencé. Dans ce cas, la Attributes propriété retourne un StringDictionary contenant la chaîne « délimiteur ».

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

Les attributs personnalisés non référencés ne sont pas énumérés. Pour plus d'informations, voir la méthode GetSupportedAttributes.

S’applique à