Switch.Attributes Egenskap

Definition

Hämtar de anpassade växelattribut som definierats i programkonfigurationsfilen.

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

Egenskapsvärde

En StringDictionary som innehåller skiftlägesokänsliga anpassade attribut för spårningsväxeln.

Exempel

Följande kodexempel visar hur du visar okända attribut för en anpassad växel.

// 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

Kommentarer

Egenskapen Attributes identifierar de anpassade attribut som refereras till i programmets konfigurationsfil. Orefererade anpassade attribut räknas inte upp. Klasser som ärver från Switch klassen kan lägga till anpassade attribut genom att GetSupportedAttributes åsidosätta metoden och returnera en strängmatris med anpassade attributnamn.

Gäller för