SwitchAttribute(String, Type) 생성자

정의

SwitchAttribute 클래스의 새 인스턴스를 초기화하고 스위치의 이름과 형식을 지정합니다.

public:
 SwitchAttribute(System::String ^ switchName, Type ^ switchType);
public SwitchAttribute (string switchName, Type switchType);
new System.Diagnostics.SwitchAttribute : string * Type -> System.Diagnostics.SwitchAttribute
Public Sub New (switchName As String, switchType As Type)

매개 변수

switchName
String

스위치의 표시 이름입니다.

switchType
Type

스위치의 형식입니다.

예제

다음 코드 예제에서는 switch 특성을 만드는 생성자를 사용 SwitchAttribute 하는 방법을 보여 있습니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 TraceSource 클래스입니다.

[SwitchAttribute("SourceSwitch", typeof(SourceSwitch))]
static void Main()
<SwitchAttribute("SourceSwitch", GetType(SourceSwitch))> _
Shared Sub Main()

설명

매개 변수는 switchName 스위치의 속성과 DisplayName 일치해야 합니다.

적용 대상