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[]

Type의 해당 요소에 대한 형식을 나타내는 args 개체의 배열입니다.

예외

args이(가) null인 경우

또는 args의 요소 중 하나가 null인 경우

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

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 GetTypeArray 배열의 요소의 형식을 나열 하는 방법입니다.

array<Object^>^myObject = gcnew array<Object^>(3);
myObject[ 0 ] = 66;
myObject[ 1 ] = "puri";
myObject[ 2 ] = 33.33;

// Get the array of 'Type' class objects.
array<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 );

}
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);
}
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

적용 대상