2020-02-25 16:45:43 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Wox.Infrastructure.Storage;
|
|
|
|
|
|
using Wox.Infrastructure.UserSettings;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Wox.Plugin.Caculator.ViewModels
|
|
|
|
|
|
{
|
|
|
|
|
|
public class SettingsViewModel : BaseModel, ISavable
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly PluginJsonStorage<Settings> _storage;
|
|
|
|
|
|
|
|
|
|
|
|
public SettingsViewModel()
|
|
|
|
|
|
{
|
|
|
|
|
|
_storage = new PluginJsonStorage<Settings>();
|
|
|
|
|
|
Settings = _storage.Load();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Settings Settings { get; set; }
|
|
|
|
|
|
|
2020-02-26 19:46:27 +00:00
|
|
|
|
public IEnumerable<int> MaxDecimalPlacesRange => Enumerable.Range(1, 20);
|
|
|
|
|
|
|
2020-02-25 16:45:43 +00:00
|
|
|
|
public void Save()
|
|
|
|
|
|
{
|
|
|
|
|
|
_storage.Save();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|