public void AddSchedule(HMessage packet, int interval, int cycles, SKoreHotkey.KeyCombination hotkey, bool autoStart) { ListViewItem item = AddFocusedItem(packet, packet.Destination, interval, cycles, hotkey?.ToString() ?? "", "Stopped"); var schedule = new HSchedule(packet, interval, cycles); schedule.ScheduleTick += OnScheduleTick; schedule.Hotkey = new SKoreHotkey(hotkey); schedule.ScheduleHotkey += OnScheduleHotkey; _items.Add(schedule, item); item.Tag = schedule; item.Checked = autoStart; }
protected override void OnKeyDown(KeyEventArgs e) { e.SuppressKeyPress = true; this.Value = new SKoreHotkey.KeyCombination(e.Modifiers, e.KeyCode); }