SwitchAttribute(String, Type) 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
스위치의 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 일치해야 합니다.