Newtonsoft.Json
This commit is contained in:
parent
5b9bd72308
commit
15361151d9
@ -1,5 +1,4 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Млаумчерб.Клиент;
|
||||
|
||||
@ -25,7 +24,7 @@ public class Config
|
||||
}
|
||||
|
||||
string text = File.ReadAllText(FileName);
|
||||
Config? c = JsonSerializer.Deserialize<Config>(text);
|
||||
Config? c = JsonConvert.DeserializeObject<Config>(text);
|
||||
if (c is not null)
|
||||
Instance = c;
|
||||
else
|
||||
@ -41,10 +40,7 @@ public class Config
|
||||
public static void SaveToFile()
|
||||
{
|
||||
//TODO: log
|
||||
var text = JsonSerializer.Serialize(Instance, new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true
|
||||
});
|
||||
var text = JsonConvert.SerializeObject(Instance, Formatting.Indented);
|
||||
File.WriteAllText(FileName, text, UTF8WithoutBom);
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,7 @@
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.3" />
|
||||
<PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.6" />
|
||||
<PackageReference Include="MessageBox.Avalonia" Version="3.1.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
0
Млаумчерб.Клиент/собрать
Normal file → Executable file
0
Млаумчерб.Клиент/собрать
Normal file → Executable file
Loading…
Reference in New Issue
Block a user