isolatedstorage

How to save a list of objects in isolated storage in wp7

社会主义新天地 提交于 2019-12-14 02:15:06
问题 Hi I have this class to save RSS feed items. I have a list of them and I want to store it in isolated storage in Windows phone 7. Can somebody help me for that. I know how to serialize the class and save it in the isolated storage as a single object for a single RSS item. public class RssItem { public RssItem(string title, string summary, string publishedDate, string url ,string subtitle ,string duration, Enclosure enclosure) { Title = title; Summary = summary; PublishedDate = publishedDate;

How to save and retrieve lists in PhoneApplicationService.Current.State?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 21:30:27
问题 I need to store and retrieve lists in PhoneApplicationService.Current.State[] but this is not a list of strings or integers: public class searchResults { public string title { get; set; } public string description { get; set; } } public List<searchResults> resultData = new List<searchResults>() { // }; The values of the result are fetched from internet and when the application is switched this data needs to be saved in isolated storage for multitasking. How do I save this list and retrieve it

Isolated storage reading data : System.Xml.XmlException: Unexpected XML declaration

我与影子孤独终老i 提交于 2019-12-13 19:20:03
问题 I am writing the data and reading it, i am getting the exception as "System.Xml.XmlException: Unexpected XML declaration" ,i am unable to figure it out whats the issue. I have also added the exception that its printing.Please help me to solve the issue. Here my code: public static void WriteTopicState(Topic topic) { try { using (var store = IsolatedStorageFile.GetUserStoreForApplication()) { using (StreamWriter sw = new StreamWriter(store.OpenFile("Stats.xml", FileMode.Append, FileAccess

How do you Automatically open(play) file after it is saved to isolation storage? WP8

巧了我就是萌 提交于 2019-12-13 05:28:27
问题 I think it should go somewhere in the OpenReadCompleted event but nothing I have tried is working. The code below includes the portion where if the file already exists, it will Play, which works. But I would like it to also play automatically after initially downloading. audioStream = IsolatedStorageFile.GetUserStoreForApplication().OpenFiledata.SavePath,FileMode.Open, FileAccess.Read, FileShare.Read); AudioPlayer.SetSource(audioStream); AudioPlayer.Play(); } else { WebClient client = new

Write/Restore ObservableCollection<T>

允我心安 提交于 2019-12-13 02:27:08
问题 I have huge problem with saveing and restore ObservableCollection to IsolatedData. I'm trying with this code. Helper class for Observable public class ListItem { public String Title { get; set; } public bool Checked { get; set; } public ListItem(String title, bool isChecked=false) { Title = title; Checked = isChecked; } private ListItem() { } } IsoHelper public class IsoStoreHelper { private static IsolatedStorageFile _isoStore; public static IsolatedStorageFile IsoStore { get { return

Can two Silverlight applications share IsolatedStorage on one machine?

为君一笑 提交于 2019-12-12 10:56:50
问题 What identifies an silverlight application and when can two silverlight applications share IsolatedStorage if at all, i.e.: if I want to have two Silverlight applications share IsolatedStorage space, is this possible? What kind of "application id" do I need to give to do this? if I don't want two Silverlight applications to share IsolatedStorage, how do I prevent this? Do I need to do this? For instance, I've noticed when I develop a Silverlight application, I can press F5, in the application

Where is isolated storage from WP7 emulator located on PC?

泪湿孤枕 提交于 2019-12-12 10:34:27
问题 When we use simulator and store files in isolated storage. Where is the file actually stored on computer? I mean the path. 回答1: If by "simulator" you mean the emulator then this data is not stored in a "real" folder on the host PC. The emulator is (for arguments sake) a virtual machine and so has it's entire folder structure stored separately. On the assumption that you don't just want to know this but rather work with the files in Isolated Storage (as part of your development/testing process

IsolatedStorageFile.GetLastWriteTime for .NET 3.5

别等时光非礼了梦想. 提交于 2019-12-12 10:21:18
问题 I am trying to see if I can port a .NET 4 project (specifically, Cassette) to 3.5. I finished the entire main project but now I'm on the last error and I can't seem to figure out a workaround. Cassette uses Isolated Storage to store asset files and in .NET 4 the related classes have been overhauled to be much more useful. In .NET 3.5, however, there are a lot of things missing. I am stuck on getting the last write time of an isolated file. Is there a way to do this in 3.5 or is it a lost

Storing a large list in isolatedStorage on WP7

蹲街弑〆低调 提交于 2019-12-12 09:45:37
问题 I'm storing a List with around 3,000 objects in Isolatedstorage using Xml serialize. It takes too long to deserialize this and I was wondering if you have any recommendations to speed it up. The time is tolerable to deserialize up to 500 objects, but takes forever to deserialize 3000. Does it take longer just on the emulator and will be faster on the phone? I did a whole bunch of searching and some article said to use a binary stream reader, but I can't find it. Whether I store in binary or

Saving PNG image to Isolated Storage for WP7

扶醉桌前 提交于 2019-12-12 08:16:24
问题 There has been quite a few image-to-isolated-storage questions here, but I couldn't find a good answer for my situation - so here we go. I am fetching a .png image from the web, and saving it as a BitmapImage -object. When it's done loading (on the BitmapImage.ImageOpened event), I want to save it to isolated storage. So, how can I get the bytes or file stream from this BitmapImage (or directly from the web - doesn't matter) so that I can write it to my IsolatedStorageFileStream ? I can't