Type.IsAbstract プロパティ
アセンブリ: 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

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


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

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