Ejemplo n.º 1
0
        public ActionResult GetButtons(string controller, string action)
        {
            List <VButton> button = new List <VButton>();

            try
            {
                var buttonList = _IButtonBLL.GetALL();
                var roleList   = _IUserMenuBLL.GetALL(p => p.UserID == 1005);
                var model      = _IMenuBLL.GetALL(p => p.Controller.Equals(controller) && p.Action.Equals(action)).First();
                var menuList   = _IMenuBLL.GetALL(a => a.type == (int)@enum.Button.button && a.Parent == model.ID && a.Status == (int)Status.Start);
                var list       = new List <Menu>();
                list = menuList.OrderBy(a => a.Index).ToList();
                //(from a in menuList join b in roleList on a.ID equals b.MenuID select a).OrderBy(a => a.Index).ToList();

                foreach (var item in list)
                {
                    VButton v = new VButton();
                    v.text  = item.Text;
                    v.style = buttonList.FirstOrDefault(a => a.ID.Equals(item.Click)).Icon;
                    v.click = buttonList.FirstOrDefault(a => a.ID.Equals(item.Click)).Click;
                    button.Add(v);
                }
                return(PartialView(button));
            }
            catch (Exception)
            {
                return(PartialView(button));
            }
        }
Ejemplo n.º 2
0
        public ButtonState GetButtonState(VButton button)
        {
            if (m_ButtonStates[(int)button] != ButtonState.None)
            {
                return(m_ButtonStates[(int)button]);
            }

            m_ButtonStates[(int)button] = m_Buttons[(int)button].GetButtonState();
            return(m_ButtonStates[(int)button]);
        }
Ejemplo n.º 3
0
        public float GetButtonHeldTime(XboxController id, VButton button)
        {
            int idToCheck = (int)id - 1;

            if (idToCheck < 0 || idToCheck > m_Controllers.Length - 1)
            {
                return(0);
            }

            return(m_Controllers[idToCheck].GetButtonHeldTime(button));
        }
Ejemplo n.º 4
0
        public IsButtonPressed CheckIsButtonPressed(XboxController id, VButton button)
        {
            int idToCheck = (int)id - 1;

            if (idToCheck < 0 || idToCheck > m_Controllers.Length - 1)
            {
                return(IsButtonPressed.NotPressed);
            }

            return(m_Controllers[idToCheck].GetIsButtonPressed(button));
        }
Ejemplo n.º 5
0
        public ButtonState GetButtonState(XboxController id, VButton button)
        {
            int idToCheck = (int)id - 1;

            if (idToCheck < 0 || idToCheck > m_Controllers.Length - 1)
            {
                return(ButtonState.NotPressed);
            }

            return(m_Controllers[idToCheck].GetButtonState(button));
        }
Ejemplo n.º 6
0
        public IsButtonPressed GetIsButtonPressed(VButton button)
        {
            if (m_ButtonsPressed[(int)button] != IsButtonPressed.None)
            {
                return(m_ButtonsPressed[(int)button]);
            }

            switch (GetButtonState(button))
            {
            case ButtonState.Held:
                m_ButtonsPressed[(int)button] = IsButtonPressed.IsPressed;
                return(m_ButtonsPressed[(int)button]);

            case ButtonState.Down:
                m_ButtonsPressed[(int)button] = IsButtonPressed.IsPressed;
                return(m_ButtonsPressed[(int)button]);

            default:
                m_ButtonsPressed[(int)button] = IsButtonPressed.NotPressed;
                return(m_ButtonsPressed[(int)button]);
            }
        }
Ejemplo n.º 7
0
 public float GetButtonHeldTime(VButton button)
 {
     return(m_ButtonHeldTimes[(int)button]);
 }