void Modify()
        {
            foreach (ListViewItem item in this.listView1.SelectedItems)
            {
                var info = (Shortcuts.ConfigInfo)item.Tag;
                using (var dlg = new ShortcutBuilder())
                {
                    dlg.Name     = info.DisplayName;
                    dlg.Shortcut = info.Shortcut;
                    if (dlg.ShowModal() == DialogResult.OK)
                    {
                        info.Shortcut = dlg.Shortcut;

                        Config.Shortcuts.SetValue(info.Name, info.Shortcut);
                        Config.Shortcuts.Save();

                        item.SubItems[1].Text = info.Shortcut;

                        modified = true;
                    }
                }
                break;
            }
        }
예제 #2
0
 public static async void RunShortcut()
 {
     Task  CreateShortCut = Task.Run(() => ShortcutBuilder.CreateShortCut());
     await CreateShortCut;
 }