示例#1
0
        public static String GetActionMethod(ActionKey action)
        {
            string actionMethod = "";

            switch (action)
            {
                case ActionKey.ListRooms:
                case ActionKey.ListUsers:
                case ActionKey.ShowRoom:
                case ActionKey.ShowUser:
                case ActionKey.GetRoomHistory:
                    actionMethod = "GET";
                    break;

                case ActionKey.DeleteUser:
                case ActionKey.CreateUser:
                case ActionKey.MessageRoom:
                case ActionKey.SetTopic:
                    actionMethod = "POST";
                    break;

                default:
                    throw new NotImplementedException(String.Format("NotImplmentedException: {0}", action.ToString()));
            }
            return actionMethod;
        }
    /// <summary> Init key bind element </summary>
    public void Init(InputType inputType, ActionKey actionKey)
    {
        Blocker.SetActive(false);
        InputType      = inputType;
        ActionKey      = actionKey;
        KeyText.text   = actionKey.ToString();
        ValueText.text = DictionaryKey.TryGetOrDefault(actionKey).ToString();

        var btn = GetComponent <CustomButton>();

        btn.onClick.AddListener(OnClickButton);
    }
示例#3
0
 public string GetString(ActionKey _Key)
 {
     TryInitialize();
     return(_Key.ToString());
 }
示例#4
0
 public string GetString( ActionKey _Key )
 {
     TryInitialize() ;
     return _Key.ToString() ;
 }
示例#5
0
        public static String GetActionUrl(ActionKey action)
        {
            var actionUrl = "";

            switch (action)
            {
                case ActionKey.ListRooms:
                    actionUrl = "rooms/list";
                    break;

                case ActionKey.ShowRoom:
                    actionUrl = "rooms/show";
                    break;

                case ActionKey.CreateRoom:
                    actionUrl = "rooms/create";
                    break;

                case ActionKey.DeleteRoom:
                    actionUrl = "rooms/delete";
                    break;

                case ActionKey.MessageRoom:
                    actionUrl = "rooms/message";
                    break;

                case ActionKey.GetRoomHistory:
                    actionUrl = "rooms/history";
                    break;

                case ActionKey.ListUsers:
                    actionUrl = "users/list";
                    break;

                case ActionKey.ShowUser:
                    actionUrl = "users/show";
                    break;

                case ActionKey.CreateUser:
                    actionUrl = "users/create";
                    break;

                case ActionKey.DeleteUser:
                    actionUrl = "users/delete";
                    break;

                case ActionKey.UpdateUser:
                    actionUrl = "users/update";
                    break;

                case ActionKey.SetTopic:
                    actionUrl = "rooms/topic";
                    break;

                //TODO: Create a custom HipChapException Type
                default:
                    throw new NotImplementedException(String.Format("NotImplementedException: {0}", action.ToString()));
            }
            return actionUrl;
        }