Yes, this is achievable, but this is quite a big work. Reflection won't help much, because it works with compiled assemblies or assemblies created during runtime, but refactoring has to work with source code.
Is there available classes? It actually depends on available compilers. There are some provisions, but they are not implemented in any of the compilers I knew so far. Here is the idea: the abstract class
has the method
which could generate a CodeDOM tree instead of compilation. Please see:
It would be a great help. Unfortunately, in all the implementations I knew so far, this method is not supported (throws "not implemented" exception). So, it looks like you don't have anything close from .NET FCL.
Of course, you can try to find some 3rd
-party products, but this is a different story.