better deserialization
This commit is contained in:
parent
7ed993e51d
commit
0e787bbca8
1 changed files with 11 additions and 4 deletions
|
@ -90,11 +90,18 @@ namespace BSLManager.Tools
|
|||
|
||||
private LocalSettingsData GetLocalSettingsFile()
|
||||
{
|
||||
if (!File.Exists(LocalFileName)) return null;
|
||||
try
|
||||
{
|
||||
if (!File.Exists(LocalFileName)) return null;
|
||||
|
||||
var jsonContent = File.ReadAllText(LocalFileName);
|
||||
var content = JsonConvert.DeserializeObject<LocalSettingsData>(jsonContent);
|
||||
return content;
|
||||
var jsonContent = File.ReadAllText(LocalFileName);
|
||||
var content = JsonConvert.DeserializeObject<LocalSettingsData>(jsonContent);
|
||||
return content;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveLocalSettings(LocalSettingsData data)
|
||||
|
|
Reference in a new issue