SwitchLevelAttribute.SwitchLevelType Propriedade

Definição

Obtém ou define o tipo que determina se um rastreamento deve ser gravado.Gets or sets the type that determines whether a trace should be written.

public:
 property Type ^ SwitchLevelType { Type ^ get(); void set(Type ^ value); };
public Type SwitchLevelType { get; set; }
member this.SwitchLevelType : Type with get, set
Public Property SwitchLevelType As Type

Valor da propriedade

Type

O Type que determina se um rastreamento deve ser gravado.The Type that determines whether a trace should be written.

Exceções

A operação de conjuntos falhou porque o valor é null.The set operation failed because the value is null.

Exemplos

O exemplo de código a seguir exibe o valor da SwitchLevelType propriedade para o BooleanSwitch .The following code example displays the value of the SwitchLevelType property for the BooleanSwitch.

// Display the SwitchLevelAttribute for the BooleanSwitch.
Object[] attribs = typeof(BooleanSwitch).GetCustomAttributes(typeof(SwitchLevelAttribute), false);
if (attribs.Length == 0)
    Console.WriteLine("Error, couldn't find SwitchLevelAttribute on BooleanSwitch.");
else
    Console.WriteLine(((SwitchLevelAttribute)attribs[0]).SwitchLevelType.ToString());
' Display the SwitchLevelAttribute for the BooleanSwitch.
Dim attribs As [Object]() = GetType(BooleanSwitch).GetCustomAttributes(GetType(SwitchLevelAttribute), False)
If attribs.Length = 0 Then
    Console.WriteLine("Error, couldn't find SwitchLevelAttribute on BooleanSwitch.")
Else
    Console.WriteLine(CType(attribs(0), SwitchLevelAttribute).SwitchLevelType.ToString())
End If

Comentários

A Propriedade Level de uma opção não é necessariamente nomeada Level ; por exemplo, a Propriedade Level da BooleanSwitch classe é Enabled .The level property of a switch is not necessarily named Level; for example, the level property of the BooleanSwitch class is Enabled.

Aplica-se a