It calls the derived class method, tested using this code
class Class1
{
[STAThread]
static void Main(string[] args)
{
Base b = new Derived();
MethodInvoker mi = new MethodInvoker(b.Test);
mi();
System.Console.ReadLine();
}
}
public class Base
{
public virtual void Test()
{
System.Console.WriteLine("Base");
}
}
public class Derived : Base
{
public override void Test()
{
System.Console.WriteLine("Derived");
}
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.