다음을 통해 공유


Switch 생성자

정의

Switch 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
Switch(String, String)

Switch 클래스의 새 인스턴스를 초기화합니다.

Switch(String, String, String)

스위치의 표시 이름, 설명 및 기본값을 지정하여 클래스의 Switch 새 인스턴스를 초기화합니다.

Switch(String, String)

Source:
Switch.cs
Source:
Switch.cs
Source:
Switch.cs
Source:
Switch.cs
Source:
Switch.cs

Switch 클래스의 새 인스턴스를 초기화합니다.

protected:
 Switch(System::String ^ displayName, System::String ^ description);
protected Switch(string displayName, string? description);
protected Switch(string displayName, string description);
new System.Diagnostics.Switch : string * string -> System.Diagnostics.Switch
Protected Sub New (displayName As String, description As String)

매개 변수

displayName
String

스위치의 이름입니다.

description
String

스위치에 대한 설명입니다.

설명

Switch 개체를 만들 때 매개 변수 값 displayName 은 초기 스위치 설정을 찾는 데 사용됩니다. 기본값은 빈 문자열("")입니다.

.NET Framework 앱의 XML 구성 파일 내에서 스위치를 추가하고 해당 값을 설정하거나, 스위치를 제거하거나, 애플리케이션에서 이전에 설정한 모든 스위치를 지울 수 있습니다. 애플리케이션이 실행되는 동안 구성 파일에 대한 동적 변경 내용이 검색되지 않습니다. 구성 파일의 변경 내용이 적용되기 전에 애플리케이션을 중지하고 다시 시작해야 합니다. 구성 파일의 형식은 다음 예제와 같이 지정해야 합니다.

<configuration>
  <system.diagnostics>
    <switches>
      <add name="mySwitch" value="10" />
      <add name="myNewSwitch" value="20" />
      <remove name="mySwitch" />
      <clear/>
    </switches>
  </system.diagnostics>
</configuration>

상속자 참고

스위치 값을 설정하려면 생성자에서 속성을 설정합니다 SwitchSetting .

추가 정보

적용 대상

Switch(String, String, String)

Source:
Switch.cs
Source:
Switch.cs
Source:
Switch.cs
Source:
Switch.cs
Source:
Switch.cs

스위치의 표시 이름, 설명 및 기본값을 지정하여 클래스의 Switch 새 인스턴스를 초기화합니다.

protected:
 Switch(System::String ^ displayName, System::String ^ description, System::String ^ defaultSwitchValue);
protected Switch(string displayName, string? description, string defaultSwitchValue);
protected Switch(string displayName, string? description, string? defaultSwitchValue);
protected Switch(string displayName, string description, string defaultSwitchValue);
new System.Diagnostics.Switch : string * string * string -> System.Diagnostics.Switch
Protected Sub New (displayName As String, description As String, defaultSwitchValue As String)

매개 변수

displayName
String

스위치의 이름입니다.

description
String

스위치에 대한 설명입니다.

defaultSwitchValue
String

스위치의 기본값입니다.

설명

매개 변수는 displayName 속성 값을 DisplayName 설정하는 데 사용되며 description 매개 변수는 속성 값을 Description 설정하는 데 사용됩니다. defaultSwitchValue 속성이 코드 또는 구성 파일 특성에 의해 설정되지 않은 경우 Value 매개 변수는 스위치의 값입니다. Switch(String, String) 추가 정보는 오버로드를 참조하세요.

적용 대상