SourceSwitch.Level 属性

定义

获取或设置开关级别。Gets or sets the level of the switch.

public:
 property System::Diagnostics::SourceLevels Level { System::Diagnostics::SourceLevels get(); void set(System::Diagnostics::SourceLevels value); };
public System.Diagnostics.SourceLevels Level { get; set; }
member this.Level : System.Diagnostics.SourceLevels with get, set
Public Property Level As SourceLevels

属性值

SourceLevels

SourceLevels 值之一,表示开关的事件级别。One of the SourceLevels values that represents the event level of the switch.

示例

下面的代码示例显示 Level 了源开关的属性的值。The following code example displays the value of the Level property for a source switch. 此代码示例是为类提供的更大示例的一部分 TraceSourceThis code example is part of a larger example provided for the TraceSource class.

Console.WriteLine(sourceSwitch.Level);
Console.WriteLine(sourceSwitch.Level)

注解

此属性从属性中获取其值 SwitchSettingThis property gets its value from the SwitchSetting property. 设置此属性还会修改 SwitchSetting 属性。Setting this property also modifies the SwitchSetting property.

备注

对于扩展性, Level 可将属性设置为任意整数,而不是限制为 SourceLevels 枚举值。For extensibility, the Level property can be set to any integer, rather than being limited to a SourceLevels enumeration value.

适用于