SwitchLevelAttribute.SwitchLevelType Vlastnost

Definice

Získá nebo nastaví typ, který určuje, zda má být zapsán trasování.

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

Hodnota vlastnosti

Určuje Type , zda má být zapsáno trasování.

Výjimky

Operace nastavení selhala, protože hodnota je null.

Příklady

Následující příklad kódu zobrazí hodnotu SwitchLevelType vlastnosti pro BooleanSwitch.

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

Poznámky

Vlastnost level přepínače nemusí být nutně pojmenovaná Level; například vlastnost BooleanSwitch level třídy je Enabled.

Platí pro