Type.GetElementType メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As Type Dim returnValue As Type returnValue = instance.GetElementType
public abstract Type GetElementType ()
public abstract Type GetElementType ()
現在の配列、ポインタ、または参照型によって包含または参照されるオブジェクト の Type。現在の Type が配列またはポインタではない場合、参照によって渡されない場合、ジェネリック型やジェネリック型またはジェネリック メソッドの定義の型パラメータを表している場合は、null 参照 (Visual Basic では Nothing)。


GetElementType メソッドを使用する例を次に示します。
Imports System Class TestGetElementType Public Shared Sub Main() Dim array As Integer() = {1, 2, 3} Dim t As Type = array.GetType() Dim t2 As Type = t.GetElementType() Console.WriteLine("The element type of {0} is {1}.", array, t2.ToString()) Dim newMe As New TestGetElementType() t = newMe.GetType() t2 = t.GetElementType() If t2 Is Nothing Then Console.WriteLine("The element type of {0} is {1}.", newMe, "null") Else Console.WriteLine("The element type of {0} is {1}.", newMe, t2.ToString()) End If End Sub 'Main End Class 'TestGetElementType
using System; class TestGetElementType { public static void Main() { int[] array = {1,2,3}; Type t = array.GetType(); Type t2 = t.GetElementType(); Console.WriteLine("The element type of {0} is {1}.",array, t2.ToString()); TestGetElementType newMe = new TestGetElementType(); t = newMe.GetType(); t2 = t.GetElementType(); Console.WriteLine("The element type of {0} is {1}.", newMe, t2==null? "null" : t2.ToString()); } }
using namespace System; public ref class TestGetElementType{}; int main() { array<Int32>^array = {1,2,3}; Type^ t = array->GetType(); Type^ t2 = t->GetElementType(); Console::WriteLine( "The element type of {0} is {1}.", array, t2 ); TestGetElementType^ newMe = gcnew TestGetElementType; t = newMe->GetType(); t2 = t->GetElementType(); Console::WriteLine( "The element type of {0} is {1}.", newMe, t2 == nullptr ? "null" : t2->ToString() ); }
import System.*; class TestGetElementType { public static void main(String[] args) { int array[] = { 1, 2, 3 }; Type t = array.GetType(); Type t2 = t.GetElementType(); Console.WriteLine("The element type of {0} is {1}.", array, t2.ToString()); TestGetElementType newMe = new TestGetElementType(); t = newMe.GetType(); t2 = t.GetElementType(); Console.WriteLine("The element type of {0} is {1}.", newMe, (t2 == null) ? "null" : t2.ToString()); } //main } //TestGetElementType

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_Type.GetElementType メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As _Type Dim returnValue As Type returnValue = instance.GetElementType
現在の配列、ポインタ、または参照型によって包含または参照されるオブジェクトの Type。 または 現在の Type が配列またはポインタでない場合、または参照によって渡されない場合、またはジェネリック型を表しているか、ジェネリック型定義またはジェネリック メソッド定義の型パラメータを表している場合は、null 参照 (Visual Basic では Nothing) が返されます。

このメソッドは、アンマネージ コードからマネージ クラスにアクセスするためのメソッドであるため、マネージ コードからは呼び出さないでください。
Type.GetElementType メソッドは、現在の配列、ポインタ、または参照型によって包含または参照されるオブジェクトの Type を返します。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書から_Type.GetElementTypeを検索する場合は、下記のリンクをクリックしてください。

- _Type.GetElementTypeのページへのリンク