samedi 5 août 2017

Resolving all used classes from source

In Java there are the import statements at the beginning of a source file. In most cases the full class path of each class is used (e.g. "import java.io.IOException;") in some cases a * to import the whole package. If the full class path is used it is quite simple to tell which classes are used in this file:

All imported ones and if a class is used and not imported it is in the same package.

In C# only namespaces are imported (e.g. "using System.IO;"). It is quite hard to tell which classes are actually used.

So here is my problem: I have a quite big open source C# project. It would be an overkill to use the whole assamblie or compile the source in my project. I just want to use one or two classes. These classes need other classes from the open source project and so on and so on, but in the end its still just a relatively small portion of the whole project.

Is there a tool that tells me exactly which classes are used by a class? Maybe even recursive? I could then just copy these source files in my project.





Aucun commentaire:

Enregistrer un commentaire