Exemple #1
0
 public static ListViewItem Update(this ListViewItem item, VDHotkey hotkey)
 {
     item.SubItems.Clear();
     item.SubItems[0].Text = hotkey.ActionString;
     item.SubItems.Add(hotkey.ToString());
     item.SubItems.Add(JsonConvert.SerializeObject(hotkey));
     item.ForeColor = hotkey.Registered ? Color.Black : ColorTranslator.FromHtml("#777777");
     return(item);
 }
Exemple #2
0
 public static void EnsureDefaultSettings()
 {
     if (Default == null)
     {
         Default = new Settings();
         Default.Hotkeys.AddRange(VDHotkey.CreateDefaultHotkeys_Numpad());
         Default.Hotkeys.AddRange(VDHotkey.CreateDefaultHotkeys());
         Default.Hotkeys.ForEach(hotkey => hotkey.Register());
         Save();
     }
 }
Exemple #3
0
        private bool EditHotkey(ListViewItem item, VDHotkey hotkey)
        {
            var editForm = new HotkeyForm()
            {
                Hotkey = hotkey
            };

            if (editForm.ShowDialog() == DialogResult.OK)
            {
                item.Update(hotkey);
                ButtonApply.Enabled = true;
                return(true);
            }
            return(false);
        }