This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
Examples/CodePushDemoApp/windows/CodePushDemoApp
windows/CodePush.Net46/Adapters/Storage Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -62,11 +62,12 @@ public class ApplicationDataContainer
6262 private readonly SemaphoreSlim mutex = new SemaphoreSlim ( 1 , 1 ) ;
6363
6464 const string STORAGE_NAME = "AppStorage.data" ;
65- IFile storageFile = null ;
65+ string storageFileName = null ;
6666
6767 public ApplicationDataContainer ( string name = STORAGE_NAME )
6868 {
69- storageFile = FileSystem . Current . LocalStorage . CreateFileAsync ( name , CreationCollisionOption . OpenIfExists ) . Result ;
69+ storageFileName = name ;
70+ var storageFile = FileSystem . Current . LocalStorage . CreateFileAsync ( storageFileName , CreationCollisionOption . OpenIfExists ) . Result ;
7071 var data = CodePushUtils . GetJObjectFromFileAsync ( storageFile ) . Result ;
7172
7273 if ( data != null )
@@ -90,14 +91,16 @@ async Task SaveAsync()
9091 {
9192 await mutex . WaitAsync ( ) . ConfigureAwait ( false ) ;
9293 var jobject = JObject . FromObject ( Values ) ;
94+ var storageFile = await FileSystem . Current . LocalStorage . CreateFileAsync ( storageFileName , CreationCollisionOption . OpenIfExists ) . ConfigureAwait ( false ) ;
9395 await storageFile . WriteAllTextAsync ( JsonConvert . SerializeObject ( jobject ) ) . ConfigureAwait ( false ) ;
9496 mutex . Release ( ) ;
9597 }
9698
9799 public async Task DeleteAsync ( )
98100 {
99101 Values . Clear ( ) ;
100- await storageFile . DeleteAsync ( ) ;
102+ var storageFile = await FileSystem . Current . LocalStorage . CreateFileAsync ( storageFileName , CreationCollisionOption . OpenIfExists ) . ConfigureAwait ( false ) ;
103+ await storageFile . DeleteAsync ( ) . ConfigureAwait ( false ) ;
101104 }
102105 }
103106}
You can’t perform that action at this time.
0 commit comments