@@ -27,19 +27,19 @@ public partial class ApplicationDataStorageHelper : IFileStorageHelper, ISetting
2727 /// <param name="objectSerializer">Serializer for converting stored values. Defaults to <see cref="Toolkit.Helpers.SystemSerializer"/>.</param>
2828 public ApplicationDataStorageHelper ( ApplicationData appData , Toolkit . Helpers . IObjectSerializer ? objectSerializer = null )
2929 {
30- this . AppData = appData ?? throw new ArgumentNullException ( nameof ( appData ) ) ;
31- this . Serializer = objectSerializer ?? new Toolkit . Helpers . SystemSerializer ( ) ;
30+ AppData = appData ?? throw new ArgumentNullException ( nameof ( appData ) ) ;
31+ Serializer = objectSerializer ?? new Toolkit . Helpers . SystemSerializer ( ) ;
3232 }
3333
3434 /// <summary>
3535 /// Gets the settings container.
3636 /// </summary>
37- public ApplicationDataContainer Settings => this . AppData . LocalSettings ;
37+ public ApplicationDataContainer Settings => AppData . LocalSettings ;
3838
3939 /// <summary>
4040 /// Gets the storage folder.
4141 /// </summary>
42- public StorageFolder Folder => this . AppData . LocalFolder ;
42+ public StorageFolder Folder => AppData . LocalFolder ;
4343
4444 /// <summary>
4545 /// Gets the storage host.
@@ -81,7 +81,7 @@ public static async Task<ApplicationDataStorageHelper> GetForUserAsync(User user
8181 /// <returns>True if a value exists.</returns>
8282 public bool KeyExists ( string key )
8383 {
84- return this . Settings . Values . ContainsKey ( key ) ;
84+ return Settings . Values . ContainsKey ( key ) ;
8585 }
8686
8787 /// <summary>
@@ -93,9 +93,9 @@ public bool KeyExists(string key)
9393 /// <returns>The TValue object.</returns>
9494 public T ? Read < T > ( string key , T ? @default = default )
9595 {
96- if ( this . Settings . Values . TryGetValue ( key , out var valueObj ) && valueObj is string valueString )
96+ if ( Settings . Values . TryGetValue ( key , out var valueObj ) && valueObj is string valueString )
9797 {
98- return this . Serializer . Deserialize < T > ( valueString ) ;
98+ return Serializer . Deserialize < T > ( valueString ) ;
9999 }
100100
101101 return @default ;
@@ -104,9 +104,9 @@ public bool KeyExists(string key)
104104 /// <inheritdoc />
105105 public bool TryRead < T > ( string key , out T ? value )
106106 {
107- if ( this . Settings . Values . TryGetValue ( key , out var valueObj ) && valueObj is string valueString )
107+ if ( Settings . Values . TryGetValue ( key , out var valueObj ) && valueObj is string valueString )
108108 {
109- value = this . Serializer . Deserialize < T > ( valueString ) ;
109+ value = Serializer . Deserialize < T > ( valueString ) ;
110110 return true ;
111111 }
112112
@@ -117,19 +117,19 @@ public bool TryRead<T>(string key, out T? value)
117117 /// <inheritdoc />
118118 public void Save < T > ( string key , T value )
119119 {
120- this . Settings . Values [ key ] = this . Serializer . Serialize ( value ) ;
120+ Settings . Values [ key ] = Serializer . Serialize ( value ) ;
121121 }
122122
123123 /// <inheritdoc />
124124 public bool TryDelete ( string key )
125125 {
126- return this . Settings . Values . Remove ( key ) ;
126+ return Settings . Values . Remove ( key ) ;
127127 }
128128
129129 /// <inheritdoc />
130130 public void Clear ( )
131131 {
132- this . Settings . Values . Clear ( ) ;
132+ Settings . Values . Clear ( ) ;
133133 }
134134
135135 /// <summary>
@@ -140,7 +140,7 @@ public void Clear()
140140 /// <returns>True if a value exists.</returns>
141141 public bool KeyExists ( string compositeKey , string key )
142142 {
143- if ( this . TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
143+ if ( TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
144144 {
145145 return composite . ContainsKey ( key ) ;
146146 }
@@ -158,12 +158,12 @@ public bool KeyExists(string compositeKey, string key)
158158 /// <returns>The T object.</returns>
159159 public bool TryRead < T > ( string compositeKey , string key , out T ? value )
160160 {
161- if ( this . TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
161+ if ( TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
162162 {
163163 string compositeValue = ( string ) composite [ key ] ;
164164 if ( compositeValue != null )
165165 {
166- value = this . Serializer . Deserialize < T > ( compositeValue ) ;
166+ value = Serializer . Deserialize < T > ( compositeValue ) ;
167167 return true ;
168168 }
169169 }
@@ -182,11 +182,11 @@ public bool TryRead<T>(string compositeKey, string key, out T? value)
182182 /// <returns>The T object.</returns>
183183 public T ? Read < T > ( string compositeKey , string key , T ? @default = default )
184184 {
185- if ( this . TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
185+ if ( TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
186186 {
187187 if ( composite . TryGetValue ( key , out object valueObj ) && valueObj is string value )
188188 {
189- return this . Serializer . Deserialize < T > ( value ) ;
189+ return Serializer . Deserialize < T > ( value ) ;
190190 }
191191 }
192192
@@ -203,17 +203,17 @@ public bool TryRead<T>(string compositeKey, string key, out T? value)
203203 /// <param name="values">Objects to save.</param>
204204 public void Save < T > ( string compositeKey , IDictionary < string , T > values )
205205 {
206- if ( this . TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
206+ if ( TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
207207 {
208208 foreach ( KeyValuePair < string , T > setting in values )
209209 {
210210 if ( composite . ContainsKey ( setting . Key ) )
211211 {
212- composite [ setting . Key ] = this . Serializer . Serialize ( setting . Value ) ;
212+ composite [ setting . Key ] = Serializer . Serialize ( setting . Value ) ;
213213 }
214214 else
215215 {
216- composite . Add ( setting . Key , this . Serializer . Serialize ( setting . Value ) ) ;
216+ composite . Add ( setting . Key , Serializer . Serialize ( setting . Value ) ) ;
217217 }
218218 }
219219 }
@@ -222,10 +222,10 @@ public void Save<T>(string compositeKey, IDictionary<string, T> values)
222222 composite = new ApplicationDataCompositeValue ( ) ;
223223 foreach ( KeyValuePair < string , T > setting in values )
224224 {
225- composite . Add ( setting . Key , this . Serializer . Serialize ( setting . Value ) ) ;
225+ composite . Add ( setting . Key , Serializer . Serialize ( setting . Value ) ) ;
226226 }
227227
228- this . Settings . Values [ compositeKey ] = composite ;
228+ Settings . Values [ compositeKey ] = composite ;
229229 }
230230 }
231231
@@ -237,7 +237,7 @@ public void Save<T>(string compositeKey, IDictionary<string, T> values)
237237 /// <returns>A boolean indicator of success.</returns>
238238 public bool TryDelete ( string compositeKey , string key )
239239 {
240- if ( this . TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
240+ if ( TryRead ( compositeKey , out ApplicationDataCompositeValue ? composite ) && composite != null )
241241 {
242242 return composite . Remove ( key ) ;
243243 }
@@ -248,43 +248,43 @@ public bool TryDelete(string compositeKey, string key)
248248 /// <inheritdoc />
249249 public Task < T ? > ReadFileAsync < T > ( string filePath , T ? @default = default )
250250 {
251- return this . ReadFileAsync < T > ( this . Folder , filePath , @default ) ;
251+ return ReadFileAsync < T > ( Folder , filePath , @default ) ;
252252 }
253253
254254 /// <inheritdoc />
255255 public Task < IEnumerable < ( DirectoryItemType ItemType , string Name ) > > ReadFolderAsync ( string folderPath )
256256 {
257- return this . ReadFolderAsync ( this . Folder , folderPath ) ;
257+ return ReadFolderAsync ( Folder , folderPath ) ;
258258 }
259259
260260 /// <inheritdoc />
261261 public Task CreateFileAsync < T > ( string filePath , T value )
262262 {
263- return this . CreateFileAsync < T > ( this . Folder , filePath , value ) ;
263+ return CreateFileAsync < T > ( Folder , filePath , value ) ;
264264 }
265265
266266 /// <inheritdoc />
267267 public Task CreateFolderAsync ( string folderPath )
268268 {
269- return this . CreateFolderAsync ( this . Folder , folderPath ) ;
269+ return CreateFolderAsync ( Folder , folderPath ) ;
270270 }
271271
272272 /// <inheritdoc />
273273 public Task < bool > TryDeleteItemAsync ( string itemPath )
274274 {
275- return TryDeleteItemAsync ( this . Folder , itemPath ) ;
275+ return TryDeleteItemAsync ( Folder , itemPath ) ;
276276 }
277277
278278 /// <inheritdoc />
279279 public Task < bool > TryRenameItemAsync ( string itemPath , string newName )
280280 {
281- return TryRenameItemAsync ( this . Folder , itemPath , newName ) ;
281+ return TryRenameItemAsync ( Folder , itemPath , newName ) ;
282282 }
283283
284284 private async Task < T ? > ReadFileAsync < T > ( StorageFolder folder , string filePath , T ? @default = default )
285285 {
286286 string value = await StorageFileHelper . ReadTextFromFileAsync ( folder , NormalizePath ( filePath ) ) ;
287- return ( value != null ) ? this . Serializer . Deserialize < T > ( value ) : @default ;
287+ return ( value != null ) ? Serializer . Deserialize < T > ( value ) : @default ;
288288 }
289289
290290 private async Task < IEnumerable < ( DirectoryItemType , string ) > > ReadFolderAsync ( StorageFolder folder , string folderPath )
@@ -304,7 +304,7 @@ public Task<bool> TryRenameItemAsync(string itemPath, string newName)
304304
305305 private async Task < StorageFile > CreateFileAsync < T > ( StorageFolder folder , string filePath , T value )
306306 {
307- return await StorageFileHelper . WriteTextToFileAsync ( folder , this . Serializer . Serialize ( value ) ? . ToString ( ) , NormalizePath ( filePath ) , CreationCollisionOption . ReplaceExisting ) ;
307+ return await StorageFileHelper . WriteTextToFileAsync ( folder , Serializer . Serialize ( value ) ? . ToString ( ) , NormalizePath ( filePath ) , CreationCollisionOption . ReplaceExisting ) ;
308308 }
309309
310310 private async Task CreateFolderAsync ( StorageFolder folder , string folderPath )
0 commit comments