This project is read-only.

retrieving all the methods of a type including the inherited ones

Topics: Metadata Model
Jun 28, 2012 at 2:28 PM

say i have the following type definition:

class Bar {
  public Bar() {}
  public virtual void SomeMethod() {}
  public void SomeOtherMethod() {}
}

class Foo : Bar {
  public override void SomeMethod() {}
}

is there a utility method hidden in CCI which outputs all the methods of Foo including the inherited ones? so the output given the type Foo looks like this:

.Ctor
SomeMethod
SomeOtherMethod
Equals
GetHashCode

i know how to do it on my own, by setting up a table (like the vtable) where the method's name, parameter types and parameter indices act as key, but maybe this was already done somewhere and i just didn't find it.

Jun 28, 2012 at 6:12 PM

I'm afraid it is not there to be found. It is in fact, a somewhat tricky helper to write since there are so many choices in how it could behave.