vendredi 20 février 2015

Get Type Name BUT resolve it with specified usings

There are like 1000 posts telling me how to get a TypeName, like


Get type name without full namespace in C#


Get the type name


and many many more, and all are working fine, BUT I need to get the TypeName resolved with usings provided.


For example I have the following using:



using Foo = System.Collections.Generic;


and now the following call to get the name:



var x = typeof (Foo.List<>);
var y = x.Name;


I would like to get the output



Foo.List`1


instead of only



List`1


Is this possible, or is the only choice string manipulation?






Aucun commentaire:

Enregistrer un commentaire