Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private readonly IReadOnlyDictionary<Keys, Action<ListViewItem>> _keyCombination = new Dictionary<Keys, Action<ListViewItem>>()
- {
- { Keys.A | Keys.Control, item => { item.Checked = true; item.Selected = true; } },
- { Keys.D | Keys.Control, item => { item.Checked = false; item.Selected = false; } },
- { Keys.I | Keys.Control | Keys.Shift, item => { item.Checked = !item.Checked; item.Selected = !item.Selected; } },
- };
- private void listView1_KeyDown(object sender, KeyEventArgs e)
- {
- if (!_keyCombination.TryGetValue(e.KeyData, out var handler))
- {
- return;
- }
- foreach (ListViewItem item in listView1.Items)
- {
- handler.Invoke(item);
- }
- e.SuppressKeyPress = true;
- }
- FixCommonError.cs:private void listView1_KeyDown(object sender, KeyEventArgs e)
- https://github.com/SubtitleEdit/subtitleedit/blob/7008be78ab6fbe9e1c58cb6501854f555b6df35f/src/libse/Forms/FixCommonErrors/FixContinuationStyle.cs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement