Hi

I've been trying match up instances of TypeReference with others of 
TypeDefinition and also MethodReference with MethodDefinition.

The idea is to detect unused code/count references for each definition.

So far I have done the matching using the FullName property. This works 
fine as long as generics is not involved.

With generic classes I have been somewhat successful:

TypeReference dt;
if (dt is TypeSpecification)
                    dt = ((TypeSpecification)dt).ElementType;
var key = dt.FullName;

But with methods it is not that trivial. Since generics in the return 
argument, the method itself and in arguments can all make the FullName 
property different.
I've begun to unwrap the structures and temporarily replace the generic 
version with its ElementType, then get FullName of the method and finally 
restore the original generic versions.
But I get the feeling that it must be a better way?

-- 
-- 
--
mono-cecil
--- 
You received this message because you are subscribed to the Google Groups 
"mono-cecil" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to