I am using Resource file(.Resx format) to store configuration settings for a WP7 application. I want to edit(and optionally create) resource files programatically in code. I googled around, and found that some of the classes are not available in WP7 SDK, which are present as a part of usual .Net framework.
So, my question is that, is there a way to edit the resx files in code?
I am only storing strings (key, value pair) as settings in resource files. So, is there something else I can do to store these values.
Reference:: System.Resources namespace in:
1) .Net framework 4 - http://msdn.microsoft.com/en-us/library/system.resources.aspx
2) WP7 SDK - http://msdn.microsoft.com/en-us/library/system.resources(v=VS.95).aspx
WP7 Newbie Here!!, Help is much appreciated.
Update:
My Use case for the above scenario.
1) It's a read frequently, update once in a while configuration settings.
2) I need to access about 300+ such settings, and want to do as much minimum (directly invoking I/O functions) as possible.
You can store them in IsolatedStorageSettings which is very well managed in WP7 applications.
IsolatedStorageSettings.ApplicationSettings["Key"] = object;
Just one point, beware that IsolatedStorageSettings is persisted to phone when your application is tombestoned or exitted. In case of unexpected exit it will not persist on the phone. Although you can always enforce persisting it using the following code:
IsolatedStorageSettings.ApplicationSettings.Save();