private void load() { AppSaveData data; if (MainAppSaveLoader.TryLoad(out data)) { if (data.Smiles != null) { LoadSmiles(data.Smiles.Select(_smiles.InstantiateSmile)); } setHotkey(data.Key, data.ModsKeys); } }
private void unload() { var hotKey = _hotKeyManager.GetHotkey("toggle"); var data = new AppSaveData(_smiles.Items) { Key = hotKey.Return(i => i.Key, Key.N), ModsKeys = hotKey.Return(h => h.Modifiers, ModifierKeys.Windows) }; MainAppSaveLoader.Save(data); _hotKeyManager.Unregister("toggle"); }