다음을 통해 공유


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

스위치의 유형입니다.

예제

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

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

설명

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

적용 대상