update to v1.4.0

This commit is contained in:
NaBian committed 2018-10-27 20:01:47 +08:00
1 parent ca0c8ce7a0
commit 9bc1208484
125 files changed
+891 -483

No files matched your search

+3
View File
@@ -1,4 +1,5 @@
using System;
using HandyControl.Data.Enum;
namespace HandyControlDemo.Data
{
@@ -7,5 +8,7 @@ namespace HandyControlDemo.Data
public static string SavePath = $"{AppDomain.CurrentDomain.BaseDirectory}AppConfig.json";
public string Lang { get; set; } = "cn";
public SkinType Skin { get; set; }
}
}
+11 -3
View File
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using Newtonsoft.Json;
namespace HandyControlDemo.Data
@@ -9,8 +10,15 @@ namespace HandyControlDemo.Data
{
if (File.Exists(AppConfig.SavePath))
{
var json = File.ReadAllText(AppConfig.SavePath);
Config = JsonConvert.DeserializeObject<AppConfig>(json);
try
{
var json = File.ReadAllText(AppConfig.SavePath);
Config = JsonConvert.DeserializeObject<AppConfig>(json);
}
catch
{
Config = new AppConfig();
}
}
else
{
@@ -15,6 +15,8 @@ namespace HandyControlDemo.Data
public DemoType Type { get; set; }
public string ImgPath { get; set; }
public List<DemoDataModel> DataList { get; set; }
}
}