Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
 public static void Close()
 {
     OSD.Close();
 }