<plugins>
<plugin selected="true">Fully.Qualified.NameOfPlugin</plugin>
<plugin selected="false">Fully.Qualified.NameOfOtherPlugin</plugin>
...
</plugins>
Yes, I'm thinking about how to store the choice between uses of the application. It's actually a choice of a particular object within a plug-in that I want to store.mskeel said:By "sessions" do you mean you fire up your application, select and run plug-ins, and then shut down your application is 1 session?
How about an XML file?
Code:<plugins> <plugin selected="true">Fully.Qualified.NameOfPlugin</plugin> <plugin selected="false">Fully.Qualified.NameOfOtherPlugin</plugin> ... </plugins>
You could also simply output the names of selected plug-ins to a text file. One per line would be easy to read.
MSDN said:The following code sample demonstrates how to attach and read a Guid object as an attribute on a user-defined class or interface.
rbulph said:I'm wondering if the simplest way to deal with this might be to trust serialization to do it for me. If I create an instance of the object and serialize it, I can then get it back with serialization. The serialization engine (if there is such a thing) will surely deal with any versioning issues for me.
Probably, but then I won't be able to create the object that's needed, so as long as I trap the error, it's not really a problem.marble_eater said:Is it possible that the deserialization will fail if the assembly is not loaded? Or is there an important detail that I am missing?
I will intialise it with a reference to an object declared as the type of interface. Do you know as a fact that it won't then create the right type of implementing object, or are you just speculating?Wile said:So far I've only used the XMLSerializer in .NET, but it needs to be initialized with the object(s) (actually the type of the object(s)) you want to serialize/deserialize. So I dont think you can leave it up to the serializer to fully instantiate the object, it needs the information about what to expect in order to work.