SwitchAttribute.SwitchType Propriedade
Definição
Obtém ou define o tipo da opção.Gets or sets the type of the switch.
public:
property Type ^ SwitchType { Type ^ get(); void set(Type ^ value); };
public Type SwitchType { get; set; }
member this.SwitchType : Type with get, set
Public Property SwitchType As Type
Valor da propriedade
O tipo da opção.The type of the switch.
Exceções
SwitchType é definido como null.SwitchType is set to null.
Exemplos
O exemplo de código a seguir exibe o valor da SwitchType propriedade para todas as opções usadas em um assembly.The following code example displays the value of the SwitchType property for all switches used in an assembly. Este exemplo de código faz parte de um exemplo maior fornecido para a TraceSource classe.This code example is part of a larger example provided for the TraceSource class.
SwitchAttribute[] switches = SwitchAttribute.GetAll(typeof(TraceTest).Assembly);
for (int i = 0; i < switches.Length; i++)
{
Console.WriteLine("Switch name = " + switches[i].SwitchName);
Console.WriteLine("Switch type = " + switches[i].SwitchType);
}
Dim switches As SwitchAttribute() = SwitchAttribute.GetAll(GetType(TraceTest).Assembly)
Dim i As Integer
For i = 0 To switches.Length - 1
Console.WriteLine("Switch name = " + switches(i).SwitchName.ToString())
Console.WriteLine("Switch type = " + switches(i).SwitchType.ToString())
Next i