Suppose that I have this class :
public class TestBase
{
public virtual bool TestMe() { }
}
and I have these classes that inherits from TestBase
Class A
public class TestA : TestBase
{
public override bool TestMe() { return false; }
}
Class B
public class TestB : TestBase
{
public override bool TestMe() { return true; }
}
Class C:
public class TestC : TestBase
{
// this will not override the method
}
I would like to return only Class A and B because they override the Method TestMe()
, How can I achieve that by creating a method in the Main class ?
public List<string> GetClasses(object Method)
{
// return the list of classes A and B .
}