T
Tom
I'm developing a plug-in system that other people are going to write modules
for. I have an interface defined, and then I have an abstract class that
implements that interface. In my abstract class, I have several functions
that a person must implement, and I also have a function that I want to
implement for them. It basically looks like this:
public abstract class MyBaseModule : IMyInterface
{
public abstract void A();
public abstract void B();
public abstract void C();
public Version GetBaseVersion()
{
return Assembly.GetExecutingAssembly().GetName().Version;
}
}
I basically just want to get the version of the base module that somebody
used to build their module against. Here's how my project works:
I have 1 directory that has everything in it (it's not a big solution). The
directory includes my solution, my base module assembly, and all of the
plug-in modules. If I update my base module assembly, every module will now
return the new base version. That makes sense looking at the code above,
but that's not what I want. I want the version of the assembly that a
particular module built against, but I don't know how to do that. Any ideas
on how I can make this happen? I basically want to force them to implement
an abstract method, but I also want to implement the abstract method for
them.
Thanks.
for. I have an interface defined, and then I have an abstract class that
implements that interface. In my abstract class, I have several functions
that a person must implement, and I also have a function that I want to
implement for them. It basically looks like this:
public abstract class MyBaseModule : IMyInterface
{
public abstract void A();
public abstract void B();
public abstract void C();
public Version GetBaseVersion()
{
return Assembly.GetExecutingAssembly().GetName().Version;
}
}
I basically just want to get the version of the base module that somebody
used to build their module against. Here's how my project works:
I have 1 directory that has everything in it (it's not a big solution). The
directory includes my solution, my base module assembly, and all of the
plug-in modules. If I update my base module assembly, every module will now
return the new base version. That makes sense looking at the code above,
but that's not what I want. I want the version of the assembly that a
particular module built against, but I don't know how to do that. Any ideas
on how I can make this happen? I basically want to force them to implement
an abstract method, but I also want to implement the abstract method for
them.
Thanks.