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


このプロパティは、Enum および ValueType を表す Type インスタンスに対して true を返します。
ClassSemanticsMask は、クラス、インターフェイス、値型のいずれとして型が宣言されているかを識別します。
現在の Type が構築ジェネリック型を表し、ジェネリック型定義がクラス定義であるためにインターフェイスまたは値型を定義しない場合、このプロパティは true を返します
現在の Type がジェネリック型またはジェネリック メソッドの定義の型パラメータを表している場合、このプロパティは常に false を返します。

型のインスタンスを作成し、その型がクラスかどうかを表示する例を次に示します。
Imports System Imports System.Reflection Imports Microsoft.VisualBasic Public Class MyDemoClass End Class 'MyDemoClass Public Class MyTypeClass Public Shared Sub Main() Try Dim myType As Type = GetType(MyDemoClass) ' Get and display the 'IsClass' property of the 'MyDemoClass' instance. Console.WriteLine(ControlChars.Cr + "Is the specified type a class? {0}.", myType.IsClass.ToString()) Catch e As Exception Console.WriteLine(ControlChars.Cr + "An exception occurred: {0}.", e.Message.ToString()) End Try End Sub 'Main End Class 'MyTypeClass
using System; using System.Reflection; public class MyDemoClass { } public class MyTypeClass { public static void Main(string[] args) { try { Type myType = typeof(MyDemoClass); // Get and display the 'IsClass' property of the 'MyDemoClass' instance. Console.WriteLine("\nIs the specified type a class? {0}.", myType.IsClass); } catch(Exception e) { Console.WriteLine("\nAn exception occurred: {0}." ,e.Message); } } }
using namespace System; using namespace System::Reflection; public ref class MyDemoClass{}; int main() { try { Type^ myType = Type::GetType( "MyDemoClass" ); // Get and display the 'IsClass' property of the 'MyDemoClass' instance. Console::WriteLine( "\nIs the specified type a class? {0}.", myType->IsClass ); } catch ( Exception^ e ) { Console::WriteLine( "\nAn exception occurred: {0}.", e->Message ); } }
import System.*; import System.Reflection.*; public class MyDemoClass { } //MyDemoClass public class MyTypeClass { public static void main(String[] args) { try { Type myType = Type.GetType("MyDemoClass"); // Get and display the 'IsClass' property of the // 'MyDemoClass' instance. Console.WriteLine("\nIs the specified type a class? {0}.", System. Convert.ToString(myType.get_IsClass())); } catch (System.Exception e) { Console.WriteLine("\nAn exception occurred: {0}.", e.get_Message()); } } //main } //MyTypeClass

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


このプロパティは、アンマネージ コードからマネージ クラスにアクセスするためのプロパティであるため、マネージ コードからは呼び出さないでください。
Type.IsClass プロパティは、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.IsClassを検索する場合は、下記のリンクをクリックしてください。

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