SwitchAttribute.GetAll(Assembly) Método

Definición

Devuelve todos los atributos de modificador para el ensamblado especificado.

public:
 static cli::array <System::Diagnostics::SwitchAttribute ^> ^ GetAll(System::Reflection::Assembly ^ assembly);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types may be trimmed from the assembly.")]
public static System.Diagnostics.SwitchAttribute[] GetAll(System.Reflection.Assembly assembly);
public static System.Diagnostics.SwitchAttribute[] GetAll(System.Reflection.Assembly assembly);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Types may be trimmed from the assembly.")>]
static member GetAll : System.Reflection.Assembly -> System.Diagnostics.SwitchAttribute[]
static member GetAll : System.Reflection.Assembly -> System.Diagnostics.SwitchAttribute[]
Public Shared Function GetAll (assembly As Assembly) As SwitchAttribute()

Parámetros

assembly
Assembly

Ensamblado que se va a comprobar si hay atributos de modificador.

Devoluciones

Matriz que contiene todos los atributos de modificador del ensamblado.

Atributos

Excepciones

assembly es null.

Ejemplos

En el ejemplo de código siguiente se muestra el uso del GetAll método para identificar los modificadores usados en un ensamblado. Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la TraceSource clase .

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

Se aplica a