-
February 14th, 2006, 03:44 AM
#1
Assemblies!?!?
Hello Gurus,
I'm writing a small game platform which offers API (Interfaces) to be implemented by others. Once one implements the interfaces he can load his game to the platform.
What i would like to do is to dynamically load (at runtime) those implemented interfaces. I would like the implementor to put his imeplementation in a subdirectory of my platform and the platform to load that game at runtime.
Should i use private assemblies for that? What is the right technology i should use?
I'm not looking for a way to monitor the directory; What i'm looking for is just the way to load a class that implements one of my interfaces and activate its methods, all done in runtime.
As you can see from my question, i'm new to C# so please if you can point me to the right direction....
Thanks.
-
February 14th, 2006, 03:51 AM
#2
Re: Assemblies!?!?
Should i use private assemblies for that?
Yes.
And Yes- U are in right direction
Best regards,
Krzemo.
PS: What u want to implement is the plugin interface. If U google for it U will find many ready to use solutions.
-
February 14th, 2006, 05:53 AM
#3
Re: Assemblies!?!?
You can use the Assembly.LoadFile method to load an assembly at run-time using a path.
You can use reflection (Assembly.GetTypes for example) to get all the types in that assembly and find out which implement the interface you need.
-
February 15th, 2006, 09:50 AM
#4
Re: Assemblies!?!?
Thanks, guys.
I use the private assemblies and it works fine.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|