示例#1
0
        public void SetButton(EnumButton button)
        {
            switch (button)
            {
            case EnumButton.OKCancel:
                buttonOk.Visible     = true;
                AcceptButton         = buttonOk;
                CancelButton         = buttonCancel;
                buttonCancel.Visible = true;
                buttonCancel.Click  += OnCloseMessage;
                break;

            case EnumButton.YesNo:
                buttonNo.Visible     = true;
                buttonYes.Visible    = true;
                buttonCancel.Visible = false;
                break;

            //case EnumButton.OK:
            default:
                buttonOk.Visible = true;
                buttonOk.Click  += OnCloseMessage;
                AcceptButton     = buttonOk;
                buttonOk.Select();
                break;
            }
        }
示例#2
0
 /// <summary>
 /// Set the button's state to true (on). If the button does pass the hard pressed test,
 /// the Gamepad manager keeps track of the situation.
 /// </summary>
 public void fireButton(EnumButton button)
 {
     buttonsState[(int)button] = true;
 }
示例#3
0
 /// <summary>
 /// Returns true if the buttons has being pressed for a threshold time enough to
 /// be considered as hard pressed. Eitherway false.
 /// </summary>
 /// <returns>bool</returns>
 /// <param name='button'>The button enum value</param>
 public bool isHardPressed(EnumButton button)
 {
     return(triggerEnabled && hardPressedCount[(int)button] >= HARD_PRESSED_MIN_COUNT);
 }
示例#4
0
 /// <summary>
 /// Returns true if the buttons has being pressed for a threshold time enough to
 /// be considered as hard pressed. Eitherway false.
 /// </summary>
 /// <returns>
 /// bool
 /// </returns>
 /// <param name='button'>
 /// The button enum value
 /// </param>
 public static bool isHardPressed(EnumButton button)
 {
     return(hardPressedCount[(int)button] >= HARD_PRESSED_MIN_COUNT);
 }