Gets a value indicating whether the method is abstract.
using System;
using System.Reflection;
class methodbase
{
public static int Main(string[] args)
{
Type MyType1 = Type.GetType("System.Runtime.Serialization.Formatter");
Type MyType2 = Type.GetType("System.Reflection.MethodBase");
MethodBase Mymethodbase1 = MyType1.GetMethod("WriteInt32", BindingFlags.NonPublic|BindingFlags.Instance);
Console.Write("\nMymethodbase = " + Mymethodbase1.ToString());
if (Mymethodbase1.IsAbstract)
Console.Write ("\nMymethodbase is an abstract method.");
else
Console.Write ("\nMymethodbase is not an abstract method.");
return 0;
}
}
Related examples in the same category