isolatedstorage

Exception when trying to delete a directory in Isolated Storage

北城以北 提交于 2019-12-11 07:04:41
问题 I get the following exception when I try to delete a directory in Isolated Storage in Windows Phone 7: An error occurred while accessing IsolatedStorage. there is no inner exception. using (var isf = IsolatedStorageFile.GetUserStoreForApplication()) { isf.DeleteDirectory(dir.TrimEnd('/')); } Notes: putting it in a try-catch will hide the exception but still directory is not deleted! before calling this I delete all files inside that using DeleteFile() so the problem can not be related to

Add an element to an XML file in IsolatedStorage

痴心易碎 提交于 2019-12-11 07:00:38
问题 I have a little problem. I try to add an element in XML with this code: using (IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication()) { if (!myStore.FileExists("categorie_settings.xml")) { using (IsolatedStorageFileStream myStream = new IsolatedStorageFileStream("categorie_settings.xml", FileMode.Create, myStore)) { XNamespace _name = ""; XDocument new_doc = new XDocument( new XDeclaration("1.0", "utf-8", ""), new XElement(_name + "Root", new XElement("Row", new

Invalid Cross Exception on Schedule Agent when working on isolated storage

丶灬走出姿态 提交于 2019-12-11 05:09:37
问题 I am working with a Windows Phone Schedule Agent and I am trying to update the picture name after sync the problem is that I am getting an invalid cross exception when on this function at line "BitmapImage bmp = new BitmapImage();" and really don’t understand why. void UpdateSyncPictureName(int AsyncStatus, int AticketID, int AsyncID, int ApictureID, int TsyncStatus = 0, int TsyncID = 0) { string filename = AsyncStatus + "-" + AticketID + "-" + AsyncID + "-" + ApictureID; using

Windows Phone 8 choose text file C#

牧云@^-^@ 提交于 2019-12-11 04:27:38
问题 i have a question. If there is a possibility at windows phone 8 at visual studio to create button event to read text file? i know about streamReader and if i declare wchich exacly file i want to read, but if i want to choose from list of files wchich i want to display. i did research on the Internet but i didint find an answer. I know i can use isolatedStorage to read music, video, image but not text files, on the app i created few files with text in it and i want users to have posibility to

How to save/load an ObservableCollection of custom class type in WP7

只愿长相守 提交于 2019-12-11 04:20:24
问题 I have created a custom class, named BrowserItem that I am using in my application, that contains a lot of values. I am using this class in an ObservableCollection to store a collection of items. For some reason, although this implementation works while my application is running, I cannot properly get these values to persist when the application closes and then reopens. I am not sure how to properly save and then reload the ObservableCollection of type BrowserItem. BrowserItem.cs

Dynamically load images from project folder - Windows Phone 7

强颜欢笑 提交于 2019-12-11 00:33:34
问题 What I want to do seems very simple, and I've done it on other platforms... Here some context: Lets say you have 1000 small images that you want to display in a databound ListBox. You start off by including the images in your project into the folder '/images'. You set their build action to 'Content'. Now the question: How do you dynamically load all these images into your app at runtime? By dynamic, I mean without having to know each name of the 1000 images. (In case you are thinking

System.IO.Packaging: Unable to determine the identity of the domain

拟墨画扇 提交于 2019-12-10 18:34:14
问题 I'm using System.IO.Packaging to create files in a completely managed desktop (Windows Forms) application. Under certain conditions, the writing of the OPC package raises the "Unable to determine the identity of the domain" exception. I have learned that it is related to Isolated Storage, as the Packaging API sometimes creates temporary data there. I haven't found a reliable reproduction of this, but I believe it occurs when data is over a certain size (a few megabytes compressed), and

WP7 - Isolated Storage settings wiped on “Rebuild”

孤街醉人 提交于 2019-12-10 10:47:21
问题 I just discovered (the hard way) that if you deploy your application to a device after doing a "Rebuild" or a "Clean -> Build" from Visual Studio your app is first uninstalled and then reinstalled resulting in the isolated storage files being wiped. The Application Deployment Tool always seems to do uninstall - reinstall irrespective of whether it was an incremental build or not. Has anybody found a workaround to this? Of course, the most obvious one is never to rebuild your application, but

Isolated Storage security exception on windows phone

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 10:47:09
问题 Im trying to persist some data but im getting an error here. Declaration of isolated storage inside my public partial mainpage class IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; implementation of onNavigatedFrom protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e) { settings.Add("list",listBox1.ItemsSource); settings.Save(); } When I hit the start button on the emulator I get a security exception: System.Security

Store must be open for this operation - System.IO.Packaging.Package

丶灬走出姿态 提交于 2019-12-10 04:45:15
问题 I am making use of the System.IO.Packaing.Package class to zip files. It is possible to have multiple instances of my application running at the same time with files being read and saved. When working with small files all seems fine, however when large files are involved if two instances of the application save at the same time I get an exception with the message Store must be open for this operation with the stack trace shown below. From my understanding when working with the packages for