Test if a method is an override?

Posted by Water Cooler v2 on Stack Overflow See other posts from Stack Overflow or by Water Cooler v2
Published on 2010-06-16T18:03:56Z Indexed on 2010/06/16 18:12 UTC
Read the original article Hit count: 135

Is there a way to tell if a method is an override? For e.g.

public class Foo
{
    public virtual void DoSomething() {}
    public virtual int GimmeIntPleez() { return 0; }
}

public class BabyFoo: Foo
{
    public override int GimmeIntPleez() { return -1; }
}

Is it possible to reflect on BabyFoo and tell if GimmeIntPleez is an override?

© Stack Overflow or respective owner

Related posts about c#

Related posts about reflection