SwitchLevelAttribute.SwitchLevelType Eigenschap

Definitie

Hiermee wordt het type ophaalt of ingesteld dat bepaalt of een tracering moet worden geschreven.

public:
 property Type ^ SwitchLevelType { Type ^ get(); void set(Type ^ value); };
public Type SwitchLevelType { get; set; }
member this.SwitchLevelType : Type with get, set
Public Property SwitchLevelType As Type

Waarde van eigenschap

Hiermee Type bepaalt u of een tracering moet worden geschreven.

Uitzonderingen

De setbewerking is mislukt omdat de waarde is null.

Voorbeelden

In het volgende codevoorbeeld wordt de waarde van de SwitchLevelType eigenschap voor de BooleanSwitcheigenschap weergegeven.

// Display the SwitchLevelAttribute for the BooleanSwitch.
Object[] attribs = typeof(BooleanSwitch).GetCustomAttributes(typeof(SwitchLevelAttribute), false);
if (attribs.Length == 0)
    Console.WriteLine("Error, couldn't find SwitchLevelAttribute on BooleanSwitch.");
else
    Console.WriteLine(((SwitchLevelAttribute)attribs[0]).SwitchLevelType.ToString());
' Display the SwitchLevelAttribute for the BooleanSwitch.
Dim attribs As [Object]() = GetType(BooleanSwitch).GetCustomAttributes(GetType(SwitchLevelAttribute), False)
If attribs.Length = 0 Then
    Console.WriteLine("Error, couldn't find SwitchLevelAttribute on BooleanSwitch.")
Else
    Console.WriteLine(CType(attribs(0), SwitchLevelAttribute).SwitchLevelType.ToString())
End If

Opmerkingen

De niveaueigenschap van een schakeloptie is niet noodzakelijkerwijs benoemd Level; bijvoorbeeld de niveaueigenschap van de BooleanSwitch klasse is Enabled.

Van toepassing op