Exemplo n.º 1
0
        private IEnumerator<object> WriteHotkeyPreference(string hotkeyName, HotkeyControl hotkeyControl)
        {
            yield return DB.SetPreference("Hotkeys." + hotkeyName + ".Key", hotkeyControl.Hotkey.ToString());

            yield return DB.SetPreference("Hotkeys." + hotkeyName + ".Modifiers", hotkeyControl.HotkeyModifiers.ToString());
        }
Exemplo n.º 2
0
        private IEnumerator<object> ReadHotkeyPreference(string hotkeyName, HotkeyControl hotkeyControl)
        {
            Future<string> f;
            yield return DB.GetPreference("Hotkeys." + hotkeyName + ".Key").Run(out f);
            hotkeyControl.Hotkey = (Keys)Enum.Parse(typeof(Keys), f.Result ?? "None", true);

            yield return DB.GetPreference("Hotkeys." + hotkeyName + ".Modifiers").Run(out f);
            hotkeyControl.HotkeyModifiers = (Keys)Enum.Parse(typeof(Keys), f.Result ?? "None", true);
        }