lundi 20 avril 2015

Mono.cecil mapping method references to interface references

I'm trying to use mono.cecil to produce a code graph - of what calls what, or more importantly, what CAN call what. Everything is going well until we get to interfaces - there seems no out of the box way to look at a class that implements an interface, and work out which function in the class actually implements that interface?

I'm doing it in two ways - first, if the method hasOverrides (ie is an explicit implementation) - I'm just reading it off - otherwise I'm trying to match up the signature.

Which works, until you get to generic methods. When I resolve the generic interface reference, so I can list the methods - I lose the generic parameter on the method.

Is there any reliable way, given a class and a generic interface it implements, of identifying for each method on the interface the class method that fulfills that interface?





Aucun commentaire:

Enregistrer un commentaire