internal void PickCurrentItem() { //fire event MenuItemChosenEventArgs e = new MenuItemChosenEventArgs(); e.selectedMenuItem = this.SelectedItem; e.currentMenu = this; if (this.MenuItemClickedEvent != null) { this.MenuItemClickedEvent(this, e); } else { OSD.Close(); } }
void formMain_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { switch (e.KeyCode) { case Keys.Down: this.MoveDown(); break; case Keys.Up: this.MoveUp(); break; case Keys.Return: case Keys.Space: if (!this.inSlideProcess) { this.PickCurrentItem(); } break; case Keys.Right: if (!this.inSlideProcess) { this.GoToSubMenu(); } break; case Keys.Back: case Keys.Left: if (!this.inSlideProcess) { this.Back(); } break; case Keys.Escape: if (!this.inSlideProcess) { this.selectedIndex = -1; OSD.Close(); } break; } }
public static void Close() { OSD.Close(); }