_Type.IsAbstract プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > _Type.IsAbstract プロパティの意味・解説 

_Type.IsAbstract プロパティ

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

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

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

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

Dim instance As _Type
Dim value As Boolean

value = instance.IsAbstract
bool IsAbstract { get; }
property bool IsAbstract {
    bool get ();
}
/** @property */
boolean get_IsAbstract ()

プロパティ
Type抽象である場合trueそれ以外場合false

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

Type.IsAbstract プロパティ

Type抽象型で、オーバーライドする必要があるかどうかを示す値を取得します

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

解説解説
使用例使用例

次の例では、指定したオブジェクトabstract である場合true返しそれ以外場合false返します

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic
Public MustInherit Class
 MyMustInheritClass
End Class 'MyMustInheritClass
Public Class [MyClass]
End Class '[MyClass]
Public Class Type_IsMustInherit
    Public Shared Sub Main()
        Try
            ' Check whether the return type of MyMustInheritClass is
 MustInherit or not.
            Console.WriteLine(ControlChars.NewLine + "Checking
 whether the type is MustInherit." + ControlChars.NewLine)

            If GetType([MyMustInheritClass]).IsAbstract
 = True Then
                Console.WriteLine("MyMustInheritClass is {0}",
 "a MustInherit class.")
            Else
                Console.WriteLine("MyMustInheritClass is {0}",
 "not a MustInherit class.")
            End If
            ' Check whether the return type of MyClass is MustInherit
 or not.
            If GetType([MyClass]).IsAbstract
 = True Then
                Console.WriteLine("MyClass is {0}",
 "a MustInherit class.")
            Else
                Console.WriteLine("MyClass is {0}",
 "not a MustInherit class.")
            End If
        Catch e As Exception
            Console.WriteLine("Exception: {0} " +
 ControlChars.Cr, e.Message.ToString())
        End Try
    End Sub 'Main
End Class 'Type_IsMustInherit
using System;
using System.Reflection;
public abstract class MyAbstractClass 
{
}
public class MyClass
{
}
public class Type_IsAbstract
{
    public static void Main()
    {
        try
        {
            // Check whether the return type of MyAbstractClass is abstract
 or not.
            Console.WriteLine("\nChecking whether the type is abstract.\n");
 
            Console.WriteLine("MyAbstractClass is {0}", (typeof(MyAbstractClass).IsAbstract)
 ? "an abstract class." : "not an abstract class.");
            // Check whether the return type of MyClass is abstract
 or not.
            Console.WriteLine("MyClass is {0}", (typeof(MyClass).IsAbstract)
 ? "an abstract class." : "not an abstract class.");
        }
        catch( Exception e )
        {
            Console.WriteLine( "Exception: {0} \n", e.Message ); 
        }
    }
}
using namespace System;
using namespace System::Reflection;

public  ref class AbstractClass abstract
{
};

public ref class NonAbstractClass
{
};

int main()
{
    // Check whether the return type of MyAbstractClass is abstract
 or not.
    Console::WriteLine("\nChecking whether the type is abstract.\n");
    if ((AbstractClass::typeid->IsAbstract))
    {
        Console::WriteLine("The AbstractClass is an abstract class.");
    }
    else
    {
        Console::WriteLine("The AbstractClass is not an abstract class.");
    }

    // Check whether the return type of MyClass is abstract or not.
    if ((NonAbstractClass::typeid->IsAbstract))
    {
        Console::WriteLine("The NonAbstractClass is an abstract class.");
    }
    else
    {
        Console::WriteLine("The NonAbstractClass is not an abstract class.");
    }
};

import System.*;
import System.Reflection.*;
abstract public class MyAbstractClass
{
} //MyAbstractClass

public class MyClass
{
} //MyClass

public class Type_IsAbstract
{
    public static void main(String[]
 args)
    {
        try {
            // Check whether the return type of MyAbstractClass is
            // abstract or not.
            Console.WriteLine("\nChecking whether the type is abstract.\n");
            Console.WriteLine("MyAbstractClass is {0}", (MyAbstractClass.class.
                ToType().get_IsAbstract()) ? "an abstract class."
 :
                "not an abstract class.");
            // Check whether the return type of MyClass is abstract
 or not.
            Console.WriteLine("MyClass is {0}", (MyClass.class.ToType().
                get_IsAbstract()) ? "an abstract class."
 :
                "not an abstract class.");
        }
        catch (System.Exception e) {
            Console.WriteLine("Exception: {0} \n", e.get_Message());
        }
    } //main
} //Type_IsAbstract
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「_Type.IsAbstract プロパティ」の関連用語

_Type.IsAbstract プロパティのお隣キーワード
検索ランキング

   

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



_Type.IsAbstract プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS