|
@ -24,17 +24,17 @@ namespace IPA.Config.Providers |
|
|
|
|
|
|
|
|
public Value Load(FileInfo file) |
|
|
public Value Load(FileInfo file) |
|
|
{ |
|
|
{ |
|
|
if (!file.Exists) return Value.Null(); |
|
|
|
|
|
|
|
|
|
|
|
JToken jtok; |
|
|
|
|
|
using (var sreader = new StreamReader(file.OpenRead())) |
|
|
|
|
|
{ |
|
|
|
|
|
using var jreader = new JsonTextReader(sreader); |
|
|
|
|
|
jtok = JToken.ReadFrom(jreader); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!file.Exists) return Value.Null(); |
|
|
|
|
|
|
|
|
try |
|
|
try |
|
|
{ |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
JToken jtok; |
|
|
|
|
|
using (var sreader = new StreamReader(file.OpenRead())) |
|
|
|
|
|
{ |
|
|
|
|
|
using var jreader = new JsonTextReader(sreader); |
|
|
|
|
|
jtok = JToken.ReadFrom(jreader); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return VisitToValue(jtok); |
|
|
return VisitToValue(jtok); |
|
|
} |
|
|
} |
|
|
catch (Exception e) |
|
|
catch (Exception e) |
|
|