SwitchAttribute.GetAll(Assembly) 메서드

정의

지정된 어셈블리에 대한 모든 스위치 특성을 반환합니다.

public:
 static cli::array <System::Diagnostics::SwitchAttribute ^> ^ GetAll(System::Reflection::Assembly ^ assembly);
public static System.Diagnostics.SwitchAttribute[] GetAll(System.Reflection.Assembly assembly);
static member GetAll : System.Reflection.Assembly -> System.Diagnostics.SwitchAttribute[]
Public Shared Function GetAll (assembly As Assembly) As SwitchAttribute()

매개 변수

assembly
Assembly

스위치 특성을 확인할 어셈블리입니다.

반품

어셈블리의 모든 스위치 특성을 포함하는 배열입니다.

예외

assemblynull입니다.

예제

다음 코드 예제에서는 어셈블리에서 GetAll 사용 하는 스위치를 식별 하는 메서드의 사용을 보여 집니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 TraceSource 일부입니다.

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

적용 대상