Share via


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

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

반환

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

예외

assembly이(가) null인 경우

예제

다음 코드 예제에서는 사용 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

적용 대상