-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update all json processing to use STJ instead of Newtonsoft
- Loading branch information
1 parent
29f4eb5
commit 28e54b2
Showing
26 changed files
with
158 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
WoWsShipBuilder.Common/Infrastructure/DataTransfer/CultureDetails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
using System.Globalization; | ||
using System.Text.Json.Serialization; | ||
using WoWsShipBuilder.Infrastructure.Utility; | ||
|
||
namespace WoWsShipBuilder.Infrastructure.DataTransfer; | ||
|
||
public sealed record CultureDetails(CultureInfo CultureInfo, string LocalizationFileName); | ||
public sealed record CultureDetails( | ||
[property: JsonConverter(typeof(CultureInfoConverter))] | ||
CultureInfo CultureInfo, | ||
string LocalizationFileName); |
18 changes: 18 additions & 0 deletions
18
WoWsShipBuilder.Common/Infrastructure/Utility/CultureInfoConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Globalization; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace WoWsShipBuilder.Infrastructure.Utility; | ||
|
||
public sealed class CultureInfoConverter : JsonConverter<CultureInfo> | ||
{ | ||
public override CultureInfo? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
return CultureInfo.CreateSpecificCulture(reader.GetString()!); | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, CultureInfo value, JsonSerializerOptions options) | ||
{ | ||
writer.WriteStringValue(value.Name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export function getAppSettings() { | ||
return window.localStorage['settings']; | ||
return JSON.parse(window.localStorage['settings']); | ||
} | ||
|
||
export function setAppSettings(settings) { | ||
window.localStorage['settings'] = settings; | ||
} | ||
window.localStorage['settings'] = JSON.stringify(settings); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.