Explore an assembly programatically...

L

Lloyd Dupont

In my current project I want to replace a library I'm using by an other one
I will write my self.

1st I want to write a skeletton library which feature all type/method I'm
using (with no real code inside).

For that I would like to go through my project, track every library object
I'm using and all the method I'm calling and create a mock-up library where
I would define all the types and and methods I'm using from the 3rd party
lib.
The thing is I would like to do it automatically through someting like
reflection.

Is there a way I could do that simply? Any tips or link?


==== here is an example: current code below ====
class MyProject
{
void AMethod(ALibObject1 obj)
{
obj.Method1();
ALibObject2 o2 = obj.Method2();
o2.Method3(new LibObject3());
}
}

I want to go through the code (or probably compiled assembly) above
(automatically), by using reflection on the assembly (or something similar)
and produce:
public class ALibObject1
{
public void Method1() {}
ALibObject2 Method2() { return null; }
}
public class ALibObject2
{
public void Method3(LibObject3 obj) {}
}
public class LibObject3
{
}
====================

Any tip on how to do that simply in an automated way?
 
G

Gabriel Lozano-Morán

One way I could think of is by using Lutz Roeder's Reflector and look for an
add-in that does something similar or maybe even write your own plugin for
Reflector. You could to do this manually but that depends on the size of the
library off course.

Gabriel Lozano-Morán
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top