Where to store settings when writing plugin? (1 Viewer)

Rhys.Goodwin

Portal Pro
November 20, 2006
336
1
Home Country
New Zealand New Zealand
Just writing a very basic plug-in and Im wondering where I should store saved settings? Can I store it in the MP database? Is there a MP API to do this? Or should I store in a stand alone xml file? In the past when coding in c# I've saved program settings to the system / user registry.

Cheers,
Rhys
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
Use something like this to read:
MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))

And something like this to write:
MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))

Plenty of MP plugin files have code that you can use to write to the configuration file, e.g. WindowPlugins\GUIAlarm\Alarm.cs, link:
http://mediaportal.svn.sourceforge..../GUIAlarm/Alarm.cs?revision=10466&view=markup

Check out the LoadAll and SaveAlarm methods in that.

Sam
 

Rhys.Goodwin

Portal Pro
November 20, 2006
336
1
Home Country
New Zealand New Zealand
Can I just ask is there official docs for classes like "MediaPortal.Profile.Settings" etc or should I just be able to use visual studio to generate docs or api reference?
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
There's some stuff in the MediaPortal Wiki, but its not very comprehensive.

Unfortunately, NDoc has been discontinued and SandCastle is still in its infancy, so it may be a while before we get MSDN-style references.

Sam
 

Users who are viewing this thread

Top Bottom