Type.IsClassとは? わかりやすく解説

Type.IsClass プロパティ

Typeクラスであり、値型インターフェイスでないかどうかを示す値を取得します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説
使用例使用例

型のインスタンス作成し、その型がクラスかどうか表示する例を次に示します

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Type クラス
Type メンバ
System 名前空間
TypeAttributes
IsInterface
IsValueType

_Type.IsClass プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

COM オブジェクトに、Type.IsClass プロパティへのバージョン依存しないアクセス用意されています。

このプロパティは、CLS準拠していません。  

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からType.IsClassを検索した結果を表示しています。
Weblioに収録されているすべての辞書からType.IsClassを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からType.IsClass を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Type.IsClass」の関連用語

Type.IsClassのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Type.IsClassのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS