Type.GetTypeArray(Object[]) 메서드

정의

지정된 배열에 있는 개체의 형식을 가져옵니다.

public:
 static cli::array <Type ^> ^ GetTypeArray(cli::array <System::Object ^> ^ args);
public static Type[] GetTypeArray(object[] args);
static member GetTypeArray : obj[] -> Type[]
Public Shared Function GetTypeArray (args As Object()) As Type()

매개 변수

args
Object[]

형식을 확인할 개체의 배열입니다.

반품

Type[]

에 있는 해당 요소Typeargs 형식을 나타내는 개체의 배열입니다.

예외

argsnull입니다.

-또는-

에 있는 요소 중 하나 이상이 있습니다 argsnull.

클래스 이니셜라이저가 호출되고 하나 이상의 예외가 throw됩니다.

예제

다음 코드 예제에서는 배열의 요소의 형식을 나열 하는 메서드를 사용 GetTypeArray 하는 방법을 보여 줍니다.

Object[] myObject = new Object[3];
myObject[0] = 66;
myObject[1] = "puri";
myObject[2] = 33.33;
// Get the array of 'Type' class objects.
Type[] myTypeArray = Type.GetTypeArray(myObject);
Console.WriteLine("Full names of the 'Type' objects in the array are:");
for(int h = 0; h < myTypeArray.Length ; h++)
{
    Console.WriteLine(myTypeArray[h].FullName);
}
let myObject = Array.zeroCreate<obj> 3
myObject[0] <- 66
myObject[1] <- "puri"
myObject[2] <- 33.33
// Get the array of 'Type' class objects.
let myTypeArray = Type.GetTypeArray myObject
printfn "Full names of the 'Type' objects in the array are:"
for h in myTypeArray do
    printfn $"{h.FullName}"
Dim myObject(2) As Object
myObject(0) = 66
myObject(1) = "puri"
myObject(2) = 33.33
' Get the array of 'Type' class objects.
Dim myTypeArray As Type() = Type.GetTypeArray(myObject)
Console.WriteLine("Full names of the 'Type' objects in the array are:")
Dim h As Integer
For h = 0 To myTypeArray.Length - 1
   Console.WriteLine(myTypeArray(h).FullName)
Next h

적용 대상