try
{
using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream stream = myIsolatedStorage.OpenFile("Reminders.xml", FileMode.Open))
{
XmlSerializer serializer = new XmlSerializer(typeof(List<Reminders>));
remind = (List<Reminders>)serializer.Deserialize(stream);
List2 = (List<Reminders>)serializer.Deserialize(stream);
}
}
}
catch { }
如何以这种方式将相同的数据添加到列表中而不必每次都从内存中读取数据?
答案 0 :(得分:1)
可以通过以下方式与Linq完成。
remind = (List<Reminders>)serializer.Deserialize(stream);
List2 = remind.ToList();