44
55using System ;
66using System . Collections . Generic ;
7- using System . Reflection ;
8- using System . Runtime . Serialization ;
97using System . Threading . Tasks ;
108using Windows . Storage ;
119
@@ -77,7 +75,7 @@ public bool KeyExists(string compositeKey, string key)
7775 /// <param name="key">Key of the object</param>
7876 /// <param name="default">Default value of the object</param>
7977 /// <returns>The T object</returns>
80- public T Read < T > ( string key , T @default = default ( T ) )
78+ public T Read < T > ( string key , T @default = default )
8179 {
8280 if ( ! Settings . Values . TryGetValue ( key , out var value ) || value == null )
8381 {
@@ -95,7 +93,7 @@ public bool KeyExists(string compositeKey, string key)
9593 /// <param name="key">Key of the object</param>
9694 /// <param name="default">Default value of the object</param>
9795 /// <returns>The T object</returns>
98- public T Read < T > ( string compositeKey , string key , T @default = default ( T ) )
96+ public T Read < T > ( string compositeKey , string key , T @default = default )
9997 {
10098 ApplicationDataCompositeValue composite = ( ApplicationDataCompositeValue ) Settings . Values [ compositeKey ] ;
10199 if ( composite != null )
@@ -120,9 +118,6 @@ public bool KeyExists(string compositeKey, string key)
120118 /// <param name="value">Object to save</param>
121119 public void Save < T > ( string key , T value )
122120 {
123- var type = typeof ( T ) ;
124- var typeInfo = type . GetTypeInfo ( ) ;
125-
126121 Settings . Values [ key ] = serializer . Serialize ( value ) ;
127122 }
128123
@@ -182,7 +177,7 @@ public Task<bool> FileExistsAsync(string filePath)
182177 /// <param name="filePath">Path to the file that contains the object</param>
183178 /// <param name="default">Default value of the object</param>
184179 /// <returns>Waiting task until completion with the object in the file</returns>
185- public async Task < T > ReadFileAsync < T > ( string filePath , T @default = default ( T ) )
180+ public async Task < T > ReadFileAsync < T > ( string filePath , T @default = default )
186181 {
187182 string value = await StorageFileHelper . ReadTextFromFileAsync ( Folder , filePath ) ;
188183 return ( value != null ) ? serializer . Deserialize < T > ( value ) : @default ;
0 commit comments