SwitchLevelAttribute.SwitchLevelType Свойство

Определение

Получает или задает тип, позволяющий определить необходимость записи трассировки.

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

Значение свойства

Тип Type, позволяющий определить необходимость записи трассировки.

Исключения

Произошел сбой операции set, поскольку значение равно null.

Примеры

В следующем примере кода отображается значение SwitchLevelType свойства для 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

Комментарии

Свойство level параметра не обязательно называется Level; например, свойство BooleanSwitch level класса имеет значение Enabled.

Применяется к