Is there a way to get all types used inside C# method?
For example,
public int foo(string str) { Bar bar = new Bar(); string x = \"test\";
If you can access the IL for this method, you might be able to do something suitable. Perhaps look at the open source project ILSpy and see whether you can leverage any of their work.