SwitchAttribute.GetAll(Assembly) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 어셈블리에 대한 모든 스위치 특성을 반환합니다.
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