fix some typo

This commit is contained in:
张弘韬 2021-05-12 03:10:03 +08:00
parent 25f6e664f2
commit a9695e3119
3 changed files with 10 additions and 10 deletions

View file

@ -8,7 +8,7 @@ using Flow.Launcher.Infrastructure.UserSettings;
namespace Flow.Launcher.Infrastructure.Storage
{
public class FlowLauncherJsonStorage<T> : JsonStrorage<T> where T : new()
public class FlowLauncherJsonStorage<T> : JsonStorage<T> where T : new()
{
public FlowLauncherJsonStorage()
{

View file

@ -9,7 +9,7 @@ namespace Flow.Launcher.Infrastructure.Storage
/// <summary>
/// Serialize object using json format.
/// </summary>
public class JsonStrorage<T> where T : new()
public class JsonStorage<T> where T : new()
{
protected T _data;
// need a new directory name
@ -23,10 +23,10 @@ namespace Flow.Launcher.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
{
@ -40,16 +40,16 @@ namespace Flow.Launcher.Infrastructure.Storage
return _data.NonNull();
}
private void Deserialize(string searlized)
private void Deserialize(string serialized)
{
try
{
_data = JsonSerializer.Deserialize<T>(searlized);
_data = JsonSerializer.Deserialize<T>(serialized);
}
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)

View file

@ -3,11 +3,11 @@ using Flow.Launcher.Infrastructure.UserSettings;
namespace Flow.Launcher.Infrastructure.Storage
{
public class PluginJsonStorage<T> :JsonStrorage<T> where T : new()
public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
{
public PluginJsonStorage()
{
// C# releated, add python releated below
// C# related, add python related below
var dataType = typeof(T);
var assemblyName = typeof(T).Assembly.GetName().Name;
DirectoryPath = Path.Combine(DataLocation.DataDirectory(), DirectoryName, Constant.Plugins, assemblyName);