Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InputAction"/> class.
 /// </summary>
 /// <param name="input">The input.</param>
 /// <param name="condition">The condition.</param>
 /// <param name="callback">The callback.</param>
 public InputAction(InputManager input, Func <IInputContext, bool> condition, IInputCallback callback)
 {
     Enabled   = true;
     Input     = input;
     Condition = condition;
     Callback  = callback;
     //subscription.Action = this;
     //Subscription = subscription;
 }
    public InputData(T cbParam, IInputCallback <T> iCB, KeyCode kC, int iT, bool perm)
    {
        callbackParameter = cbParam;
        inputCallback     = iCB;

        keyCode   = kC;
        inputType = iT;
        permanent = perm;
    }
    public void AddNewInput <T>(IInputCallback <T> iCB, T cbParam, KeyCode key, InputPressType iT, bool perm = false)
    {
        int kId       = (int)key;
        int inputType = (int)iT;

        if (!keyEvents.ContainsKey(kId))
        {
            keyEvents.Add(kId, new Dictionary <int, List <InputDataBase> >());
        }

        if (!keyEvents[kId].ContainsKey((int)iT))
        {
            keyEvents[kId].Add(inputType, new List <InputDataBase>());
        }

        keyEvents[kId][inputType].Add(new InputData <T>(cbParam, iCB, key, inputType, perm));
        //return iS.Add(new InputData<T>(cbParam, iCB, key, iT, perm));
    }
 public Builder SetInput(int hint, int prefill, IInputCallback callback)
 {
     return SetInput(hint, prefill, true, callback);
 }
 public Builder SetInput(int hint, int prefill, bool allowEmptyInput, IInputCallback callback)
 {
     return SetInput(hint == 0 ? null : Context.GetText(hint), prefill == 0 ? null : Context.GetText(prefill), allowEmptyInput, callback);
 }
 public Builder SetInput(string hint, string prefill, IInputCallback callback)
 {
     return SetInput(hint, prefill, true, callback);
 }
 public Builder SetInput(string hint, string prefill, bool allowEmptyInput, IInputCallback callback)
 {
     if (this.CustomView != null)
         throw new InvalidOperationException("You cannot set content() when you're using a custom view.");
     this.InputCallback = callback;
     this.InputHint = hint;
     this.InputPrefill = prefill;
     this.InputAllowEmpty = allowEmptyInput;
     return this;
 }