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입니다.

예외

값이 null이기 때문에 set 작업이 실패한 경우

예제

다음 코드 예제에 대 한 속성의 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.

적용 대상