isolatedstorage

How can I save the settings in the IsolatedStorage while BackgroundAudioPlayer's instance is active?

柔情痞子 提交于 2019-12-01 14:14:47
I have Two projects in my Solution. Let's say Project A and Project B. Project A It's the main project and has settings. I have a check box to give user an option to "Repeat" track(s). This project can also access PROJECT B's public instances. Project B It's the BackgroundAudioAgent and has it's own settings. This project doesn't have access to PROJECT A settings. Therefore, in PROJECT A , I need to access the settings of PROJECT B and save it there. So that, when the "Repeat" is enabled, the agent restarts playing. PROBLEM I am unable to save the settings (in other words, the settings are

How get image from isolated storage

送分小仙女□ 提交于 2019-12-01 10:49:18
I have this XAML <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}" Name="list"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Margin="0,0,0,17"> <!--Replace rectangle with image--> <Image Height="100" Width="100" Source="{Binding Img}" Margin="12,0,9,0"/> <StackPanel Width="311"> <TextBlock Text="{Binding Pos}"/> </StackPanel> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> In the Code: using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication()) { IsolatedStorageFileStream isoStoreStream = isoStore.OpenFile(

Logging with NLog into an Isolated Storage

。_饼干妹妹 提交于 2019-12-01 09:09:18
I use the NLog Libary (http://nlog-project.org/) within my C# Win Forms to do the logging. Has anyone some experiance if it's possible to write the Logfile into an "IsolatedStorage" with this NLogger? Thx 4 answers wageoghe I have not used NLog in Silverlight, but a new version, 2.0, has just been released into beta and it is usable in Silverlight (there are some examples on the website). I have not seen an Isolated Storage Target, but I bet it would not be difficult to write one. This link shows (in Christian's answer) one way to "log" to isolated storage. I can't comment on whether or not it

save image into isolated storage [duplicate]

梦想的初衷 提交于 2019-12-01 07:45:40
问题 This question already has an answer here : Closed 8 years ago . Possible Duplicate: store image into isolated storage in windows phone 7 I am using Visual Studio/Expression Blend to create my app for windows phone 7. The user should be able to select a picture that he/she wants to edit and after editing, the user can click a "save" button and the specific edited image will be saved in isolated storage. But I'm having trouble saving the image to Isolated Storage from the button click event.

C# - Save object to JSON file

僤鯓⒐⒋嵵緔 提交于 2019-12-01 06:51:20
I'm writing a Windows Phone Silverlight app. I want to save an object to a JSON file. I've written the following piece of code. string jsonFile = JsonConvert.SerializeObject(usr); IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication(); IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream("users.json", FileMode.Create, isoStore); StreamWriter str = new StreamWriter(isoStream); str.Write(jsonFile); This is enough to create a JSON file but it is empty. Am I doing something wrong? Wasn't this supposed to write the object to the file? The problem is that you

Read a file from Windows Phone 7

江枫思渺然 提交于 2019-12-01 06:23:51
I have a folder called data/ in my project that contains txt files . I configured Build Action to resources to all files. I tried these different ways: method 1 var resource = Application.GetResourceStream(new Uri(fName, UriKind.Relative)); StreamReader streamReader = new StreamReader(resource.Stream); Debug.WriteLine(streamReader.ReadToEnd()); method 2 IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication(); string[] fileNames = myIsolatedStorage.GetFileNames("*.txt"); method 3 using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())

When should I opt for IsolatedStorage versus AppData file storage?

感情迁移 提交于 2019-12-01 06:01:21
I've recently discovered the IsolatedStorage facilities in .net, and I'm wondering when I should use them for my application data versus when I should use (e.g.) Application.LocalUserAppDataPath . One thing that I've noticed is that Application doesn't exist outside of a winforms app, so it seems that IsolatedStorage might make sense for a class library that needs some specific storage, especially if that library might be used by both a web app and a winforms app. Is that the only distinguishing point, or is there more to it? (As a rule, up 'til now, I've made the app provide a file stream to

Logging with NLog into an Isolated Storage

空扰寡人 提交于 2019-12-01 05:38:51
问题 I use the NLog Libary (http://nlog-project.org/) within my C# Win Forms to do the logging. Has anyone some experiance if it's possible to write the Logfile into an "IsolatedStorage" with this NLogger? Thx 4 answers 回答1: I have not used NLog in Silverlight, but a new version, 2.0, has just been released into beta and it is usable in Silverlight (there are some examples on the website). I have not seen an Isolated Storage Target, but I bet it would not be difficult to write one. This link shows

C# - Save object to JSON file

ⅰ亾dé卋堺 提交于 2019-12-01 04:25:57
问题 I'm writing a Windows Phone Silverlight app. I want to save an object to a JSON file. I've written the following piece of code. string jsonFile = JsonConvert.SerializeObject(usr); IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication(); IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream("users.json", FileMode.Create, isoStore); StreamWriter str = new StreamWriter(isoStream); str.Write(jsonFile); This is enough to create a JSON file but it is empty. Am

When should I opt for IsolatedStorage versus AppData file storage?

不羁的心 提交于 2019-12-01 03:17:46
问题 I've recently discovered the IsolatedStorage facilities in .net, and I'm wondering when I should use them for my application data versus when I should use (e.g.) Application.LocalUserAppDataPath . One thing that I've noticed is that Application doesn't exist outside of a winforms app, so it seems that IsolatedStorage might make sense for a class library that needs some specific storage, especially if that library might be used by both a web app and a winforms app. Is that the only