Detect if a method was overridden using Reflection (C#)
Posted
by Andrey
on Stack Overflow
See other posts from Stack Overflow
or by Andrey
Published on 2010-05-28T20:47:28Z
Indexed on
2010/05/28
20:52 UTC
Read the original article
Hit count: 167
Say I have a base class TestBase where I define a vistual method TestMe()
class TestBase
{
public virtual bool TestMe() { }
}
Now I inherit this class:
class Test1 : TestBase
{
public override bool TestMe() {}
}
Now, using Reflection, I need to find if the method TestMe has been overriden in child class - is it possible?
What I need it for - I am writing a designer visualizer for type "object" to show the whole hierarchy of inheritance and also show which virtual methods were overridden at which level.
© Stack Overflow or respective owner