Windows Phone 7 isolated storage helper
While working with isolated storage on WP7, I faced a lot of problems such as deleting a folder containing files. The default behavior of the isolated storage is safe, this means it will not delete folders that contain files. I was also missing the convenience methods ReadAllLines() and WriteAllLines() we normally have in the .NET Framework 4.
I decided to write a small helper that supports this functionality. You can find a description of each below:
DeleteDirectoryRecursive()#
WP7 isolated storage does not delete folders that contain files. This method finds all subfolders, deletes files inside the subfolders and then the folder itself.
ReadAllLines()#
Reads all the lines of a file and puts them into a list. This is missing from the IsolatedStorageFile API
WriteAllLines()#
Writes all the lines of an enumerable collection to a file. If the file does not exist, it will create it. If the file already exists, it will overwrite the file. Just like ReadAllLines(), it is just a convenience method that is missing from the IsolatedStorageFile API.
The code was hosted on SkyDrive, and the download is no longer available.