mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
Spelling: ... wox (#3775)
* spelling: arguments * spelling: config * spelling: deactivated * spelling: exception * spelling: folder * spelling: initialize * spelling: makesure * spelling: response * spelling: storage * spelling: visibility * spelling: serialized * spelling: zipped
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Wox.Infrastructure.Storage
|
||||
/// <summary>
|
||||
/// Serialize object using json format.
|
||||
/// </summary>
|
||||
public class JsonStrorage<T>
|
||||
public class JsonStorage<T>
|
||||
{
|
||||
private readonly JsonSerializerSettings _serializerSettings;
|
||||
private T _data;
|
||||
@@ -20,7 +20,7 @@ namespace Wox.Infrastructure.Storage
|
||||
public string DirectoryPath { get; set; }
|
||||
|
||||
|
||||
internal JsonStrorage()
|
||||
internal JsonStorage()
|
||||
{
|
||||
// use property initialization instead of DefaultValueAttribute
|
||||
// easier and flexible for default value of object
|
||||
@@ -35,10 +35,10 @@ namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
var searlized = File.ReadAllText(FilePath);
|
||||
if (!string.IsNullOrWhiteSpace(searlized))
|
||||
var serialized = File.ReadAllText(FilePath);
|
||||
if (!string.IsNullOrWhiteSpace(serialized))
|
||||
{
|
||||
Deserialize(searlized);
|
||||
Deserialize(serialized);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -52,16 +52,16 @@ namespace Wox.Infrastructure.Storage
|
||||
return _data.NonNull();
|
||||
}
|
||||
|
||||
private void Deserialize(string searlized)
|
||||
private void Deserialize(string serialized)
|
||||
{
|
||||
try
|
||||
{
|
||||
_data = JsonConvert.DeserializeObject<T>(searlized, _serializerSettings);
|
||||
_data = JsonConvert.DeserializeObject<T>(serialized, _serializerSettings);
|
||||
}
|
||||
catch (JsonException e)
|
||||
{
|
||||
LoadDefault();
|
||||
Log.Exception($"|JsonStrorage.Deserialize|Deserialize error for json <{FilePath}>", e);
|
||||
Log.Exception($"|JsonStorage.Deserialize|Deserialize error for json <{FilePath}>", e);
|
||||
}
|
||||
|
||||
if (_data == null)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
public class PluginJsonStorage<T> :JsonStrorage<T> where T : new()
|
||||
public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
|
||||
{
|
||||
public PluginJsonStorage()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Wox.Infrastructure.Storage
|
||||
{
|
||||
public class WoxJsonStorage<T> : JsonStrorage<T> where T : new()
|
||||
public class WoxJsonStorage<T> : JsonStorage<T> where T : new()
|
||||
{
|
||||
public WoxJsonStorage()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user