コード例 #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));
            }
        }
コード例 #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]);
        }
コード例 #3
0
ファイル: InputManager.cs プロジェクト: AkliDev/CuhrayzeeBtu
        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));
        }
コード例 #4
0
ファイル: InputManager.cs プロジェクト: AkliDev/CuhrayzeeBtu
        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));
        }
コード例 #5
0
ファイル: InputManager.cs プロジェクト: AkliDev/CuhrayzeeBtu
        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));
        }
コード例 #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]);
            }
        }
コード例 #7
0
 public float GetButtonHeldTime(VButton button)
 {
     return(m_ButtonHeldTimes[(int)button]);
 }