Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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");
        }