remove useless virtual method

This commit is contained in:
bao-qian
2017-02-06 22:04:52 +00:00
parent 1a08ba0b57
commit d358a9d9fd
2 changed files with 3 additions and 18 deletions

View File

@@ -30,7 +30,7 @@ namespace Wox.Infrastructure.Storage
}; };
} }
public override T Load() public T Load()
{ {
if (File.Exists(FilePath)) if (File.Exists(FilePath))
{ {
@@ -64,13 +64,13 @@ namespace Wox.Infrastructure.Storage
} }
} }
public override void LoadDefault() public void LoadDefault()
{ {
Data = JsonConvert.DeserializeObject<T>("{}", _serializerSettings); Data = JsonConvert.DeserializeObject<T>("{}", _serializerSettings);
Save(); Save();
} }
public override void Save() public void Save()
{ {
string serialized = JsonConvert.SerializeObject(Data, Formatting.Indented); string serialized = JsonConvert.SerializeObject(Data, Formatting.Indented);
File.WriteAllText(FilePath, serialized); File.WriteAllText(FilePath, serialized);

View File

@@ -13,21 +13,6 @@ namespace Wox.Infrastructure.Storage
public string DirectoryPath { get; set; } public string DirectoryPath { get; set; }
public string DirectoryName { get; set; } public string DirectoryName { get; set; }
public virtual T Load()
{
throw new NotImplementedException();
}
public virtual void Save()
{
throw new NotImplementedException();
}
public virtual void LoadDefault()
{
throw new NotImplementedException();
}
protected Storage() protected Storage()
{ {
DataType = typeof (T); DataType = typeof (T);