4
4
5
5
using System ;
6
6
using System . Collections . Generic ;
7
- using System . Reflection ;
8
- using System . Runtime . Serialization ;
9
7
using System . Threading . Tasks ;
10
8
using Windows . Storage ;
11
9
@@ -77,7 +75,7 @@ public bool KeyExists(string compositeKey, string key)
77
75
/// <param name="key">Key of the object</param>
78
76
/// <param name="default">Default value of the object</param>
79
77
/// <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 )
81
79
{
82
80
if ( ! Settings . Values . TryGetValue ( key , out var value ) || value == null )
83
81
{
@@ -95,7 +93,7 @@ public bool KeyExists(string compositeKey, string key)
95
93
/// <param name="key">Key of the object</param>
96
94
/// <param name="default">Default value of the object</param>
97
95
/// <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 )
99
97
{
100
98
ApplicationDataCompositeValue composite = ( ApplicationDataCompositeValue ) Settings . Values [ compositeKey ] ;
101
99
if ( composite != null )
@@ -120,9 +118,6 @@ public bool KeyExists(string compositeKey, string key)
120
118
/// <param name="value">Object to save</param>
121
119
public void Save < T > ( string key , T value )
122
120
{
123
- var type = typeof ( T ) ;
124
- var typeInfo = type . GetTypeInfo ( ) ;
125
-
126
121
Settings . Values [ key ] = serializer . Serialize ( value ) ;
127
122
}
128
123
@@ -182,7 +177,7 @@ public Task<bool> FileExistsAsync(string filePath)
182
177
/// <param name="filePath">Path to the file that contains the object</param>
183
178
/// <param name="default">Default value of the object</param>
184
179
/// <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 )
186
181
{
187
182
string value = await StorageFileHelper . ReadTextFromFileAsync ( Folder , filePath ) ;
188
183
return ( value != null ) ? serializer . Deserialize < T > ( value ) : @default ;
0 commit comments