Type.BaseType プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

public abstract Type BaseType { get; }
/** @property */ public abstract Type get_BaseType ()
現在の Type の直接の継承元の Type。現在の Type が Object クラスまたはインターフェイスを表す場合は null 参照 (Visual Basic では Nothing)。

ベース型は、現在の型の直接の継承元である型です。Object はベース型を持たない唯一の型であるため、Object のベース型としては null 参照 (Visual Basic では Nothing) が返されます。
インターフェイスは 0 以上の基本インターフェイスから継承します。したがって、Type オブジェクトがインターフェイスを表す場合、このプロパティは null 参照 (Visual Basic では Nothing) を返します。基本インターフェイスは、GetInterfaces または FindInterfaces を使用して判断できます。
現在の Type が構築ジェネリック型を表している場合、基本型は汎用引数をリフレクションします。たとえば、次の宣言について考えてみます。
構築型 C<int> (Visual Basic の場合は C(Of Integer)) の場合、BaseType プロパティは B<int> を返します。
現在の Type がジェネリック型定義の型パラメータを表している場合、BaseType はクラス制約、つまり、型パラメータが継承する必要のあるクラスを返します。クラス制約がない場合、BaseType は System.Object を返します。

Imports System Class TestType Public Shared Sub Main() Dim t As Type = GetType(Integer) Console.WriteLine("{0} inherits from {1}.", t, t.BaseType) End Sub 'Main End Class 'TestType
using System; class TestType { public static void Main() { Type t = typeof(int); Console.WriteLine("{0} inherits from {1}.", t,t.BaseType); } }

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.BaseType プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

現在の Type の直接の継承元の Type。現在の Type が Object クラスを表す場合は null 参照 (Visual Basic では Nothing)。


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Type.BaseTypeのページへのリンク