示例#1
0
 /// <inheritdoc />
 protected override void onRecognized()
 {
     base.onRecognized();
     pressedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
     if (UseSendMessage && SendMessageTarget != null)
     {
         SendMessageTarget.SendMessage(PRESS_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
示例#2
0
 /// <inheritdoc />
 protected override void onChanged()
 {
     base.onChanged();
     scaledInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
     if (UseSendMessage && SendMessageTarget != null)
     {
         SendMessageTarget.SendMessage(SCALE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
        protected override void onCancelled()
        {
            Debug.Log("In onCancelled()");
            base.onCancelled();

            if (UseSendMessage && SendMessageTarget != null)
            {
                SendMessageTarget.SendMessage("OnTouchUp", this, SendMessageOptions.DontRequireReceiver);
            }
        }
示例#4
0
        /// <inheritdoc />
        protected override void onRecognized()
        {
            base.onRecognized();

            StopCoroutine("wait");
            tappedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
            if (UseSendMessage && SendMessageTarget != null)
            {
                SendMessageTarget.SendMessage(TAP_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
            }
        }
示例#5
0
 void NotifyTextChange()
 {
     if (OnTextChange != null)
     {
         OnTextChange(this);
     }
     if (SendMessageTarget != null && SendMessageOnTextChangeMethodName.Length > 0)
     {
         SendMessageTarget.SendMessage(SendMessageOnTextChangeMethodName, this, SendMessageOptions.RequireReceiver);
     }
 }
示例#6
0
 /// <inheritdoc />
 protected override void onBegan()
 {
     base.onBegan();
     panStartedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
     pannedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
     if (UseSendMessage && SendMessageTarget != null)
     {
         SendMessageTarget.SendMessage(PAN_START_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
         SendMessageTarget.SendMessage(PAN_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
 /// <inheritdoc />
 protected override void onChanged()
 {
     base.onChanged();
     if (pannedInvoker != null)
     {
         pannedInvoker(this, EventArgs.Empty);
     }
     if (UseSendMessage)
     {
         SendMessageTarget.SendMessage(PAN_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
示例#8
0
 /// <inheritdoc />
 protected override void onRecognized()
 {
     base.onRecognized();
     if (flickedInvoker != null)
     {
         flickedInvoker(this, EventArgs.Empty);
     }
     if (UseSendMessage)
     {
         SendMessageTarget.SendMessage(FLICK_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
 /// <inheritdoc />
 protected override void onRecognized()
 {
     base.onRecognized();
     if (longPressedInvoker != null)
     {
         longPressedInvoker(this, EventArgs.Empty);
     }
     if (UseSendMessage)
     {
         SendMessageTarget.SendMessage(LONG_PRESS_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
 /// <inheritdoc />
 protected override void onBegan()
 {
     base.onBegan();
     if (transformStartedInvoker != null)
     {
         transformStartedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
     }
     if (UseSendMessage && SendMessageTarget != null)
     {
         SendMessageTarget.SendMessage(TRANSFORM_START_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
示例#11
0
 /// <inheritdoc />
 protected override void onRecognized()
 {
     base.onRecognized();
     if (releasedInvoker != null)
     {
         releasedInvoker(this, EventArgs.Empty);
     }
     if (UseSendMessage && SendMessageTarget != null)
     {
         SendMessageTarget.SendMessage(RELEASE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
 /// <inheritdoc />
 protected override void onRecognized()
 {
     base.onRecognized();
     if (transformCompletedInvoker != null)
     {
         transformCompletedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
     }
     if (UseSendMessage && SendMessageTarget != null)
     {
         SendMessageTarget.SendMessage(TRANSFORM_COMPLETE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
示例#13
0
        private SendMsg(int agentID, SendMessageTarget target)
        {
            target.UserIDList = target.UserIDList ?? new List<string>();
            target.DepartmentIDList = target.DepartmentIDList ?? new List<string>();
            target.TagIDLIst = target.TagIDLIst ?? new List<string>();

            ToUser = target.IsSendAll ? "@all" : target.UserIDList.Aggregate(string.Empty, (s, c) => s + c + "|");
            ToParty = target.DepartmentIDList.Aggregate(string.Empty, (s, c) => s + c + "|");
            ToTag = target.TagIDLIst.Aggregate(string.Empty, (s, c) => s + c + "|");

            AgentID = agentID;
        }
 /// <inheritdoc />
 protected override void onRecognized()
 {
     base.onRecognized();
     if (rotateCompletedInvoker != null)
     {
         rotateCompletedInvoker(this, EventArgs.Empty);
     }
     if (UseSendMessage)
     {
         SendMessageTarget.SendMessage(ROTATE_COMPLETE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
示例#15
0
 /// <inheritdoc />
 protected override void onCancelled()
 {
     base.onCancelled();
     if (PreviousState != GestureState.Possible)
     {
         panCompletedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
         if (UseSendMessage && SendMessageTarget != null)
         {
             SendMessageTarget.SendMessage(PAN_COMPLETE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
         }
     }
 }
    private void ListenForKeyboardTextUpdate()
    {
        bool   change  = false;
        string newText = text;
        //http://docs.unity3d.com/Documentation/ScriptReference/Input-inputString.html

        string inputStr = Input.inputString;
        char   c;

        for (int i = 0; i < inputStr.Length; i++)
        {
            c = inputStr[i];
            if (c == "\b"[0])
            {
                if (text.Length != 0)
                {
                    newText = text.Substring(0, text.Length - 1);
                    change  = true;
                }
            }
            else if (c == "\n"[0] || c == "\r"[0])
            {
            }
            else if ((int)c != 9 && (int)c != 27) //deal with a Mac only Unity bug where it returns a char for escape and tab
            {
                newText += c;
                change   = true;
            }
        }

#if UNITY_IOS && !UNITY_EDITOR
        inputStr = keyboard.text;
        if (!inputStr.Equals(text))
        {
            newText = inputStr;
            change  = true;
        }
#endif
        if (change)
        {
            Text = newText;
            if (OnTextChange != null)
            {
                OnTextChange(this);
            }

            if (SendMessageTarget != null && SendMessageOnTextChangeMethodName.Length > 0)
            {
                SendMessageTarget.SendMessage(SendMessageOnTextChangeMethodName, this, SendMessageOptions.RequireReceiver);
            }
        }
    }
示例#17
0
        /// <inheritdoc />
        protected override void touchCancelled(TouchPoint touch)
        {
            base.touchCancelled(touch);

            if (touchCancelledInvoker != null)
            {
                touchCancelledInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touch));
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                SendMessageTarget.SendMessage(TOUCH_CANCELLED_MESSAGE, touch, SendMessageOptions.DontRequireReceiver);
            }
        }
        /// <summary>
        /// 发送内容消息
        /// </summary>
        /// <param name="accountID">账号ID</param>
        /// <param name="target">发送目标信息</param>
        /// <param name="message">消息内容</param>
        /// <returns>操作结果</returns>
        public OperateStatus SendTextMessage(Guid accountID, SendMessageTarget target, string message)
        {
            AccountServiceModel model = new AccountServiceModel();
            var currentAccount = model.GetById(accountID);
            if (currentAccount == null)
            {
                return new OperateStatus { ResultSign = ResultSign.Failed, Message = "账号不存在" };
            }

            var func = FunctionFactory.GetFunctionInstance<ISend>();
            OperateStatus status = func.SendTextMessage(currentAccount, target, message);
            return status;
        }
示例#19
0
        public SendMsg(int agentID, SendMessageTarget target, IList<NewsSendItem> message)
            : this(agentID, target)
        {
            MsgType = "news";

            NewsList = message;
            ArticleList = null;
            Text = null;
            Voice = null;
            Image = null;
            File = null;
            Video = null;

            Safe = null;
        }
示例#20
0
        public SendMsg(int agentID, SendMessageTarget target, string message)
            : this(agentID, target)
        {
            MsgType = "text";

            NewsList = null;
            ArticleList = null;
            Text = message;
            Voice = null;
            Image = null;
            File = null;
            Video = null;

            Safe = 0;
        }
 /// <inheritdoc />
 protected override void onCancelled()
 {
     base.onCancelled();
     if (PreviousState != GestureState.Possible)
     {
         if (rotateCompletedInvoker != null)
         {
             rotateCompletedInvoker(this, EventArgs.Empty);
         }
         if (UseSendMessage)
         {
             SendMessageTarget.SendMessage(ROTATE_COMPLETE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
         }
     }
 }
        /// <inheritdoc />
        protected override void onRecognized()
        {
            base.onRecognized();

            // need to clear moved touches updateMoved() wouldn't fire in a wrong state
            // yes, if moved and released the same frame movement data will be lost
            movedTouches.Clear();
            if (transformCompletedInvoker != null)
            {
                transformCompletedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                SendMessageTarget.SendMessage(TRANSFORM_COMPLETE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
            }
        }
示例#23
0
 /// <inheritdoc />
 protected override void onRecognized()
 {
     base.onRecognized();
     if (longPressedInvoker != null)
     {
         longPressedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
     }
     if (UseSendMessage && SendMessageTarget != null)
     {
         SendMessageTarget.SendMessage(LONG_PRESS_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
     if (UseUnityEvents)
     {
         OnLongPress.Invoke(this);
     }
 }
 /// <inheritdoc />
 protected override void onBegan()
 {
     base.onBegan();
     if (rotateStartedInvoker != null)
     {
         rotateStartedInvoker(this, EventArgs.Empty);
     }
     if (rotatedInvoker != null)
     {
         rotatedInvoker(this, EventArgs.Empty);
     }
     if (UseSendMessage)
     {
         SendMessageTarget.SendMessage(ROTATE_START_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
         SendMessageTarget.SendMessage(ROTATE_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
     }
 }
示例#25
0
        /// <inheritdoc />
        protected override void touchEnded(TouchPoint touch)
        {
            base.touchEnded(touch);

            if ((State == GestureState.Began || State == GestureState.Changed) && NumTouches == 0)
            {
                setState(GestureState.Ended);
            }

            if (touchEndedInvoker != null)
            {
                touchEndedInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touch));
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                SendMessageTarget.SendMessage(TOUCH_ENDED_MESSAGE, touch, SendMessageOptions.DontRequireReceiver);
            }
        }
示例#26
0
        /// <inheritdoc />
        protected override void touchBegan(TouchPoint touch)
        {
            base.touchBegan(touch);

            if (State == GestureState.Possible)
            {
                setState(GestureState.Began);
            }

            if (touchBeganInvoker != null)
            {
                touchBeganInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touch));
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                SendMessageTarget.SendMessage(TOUCH_BEGAN_MESSAGE, touch, SendMessageOptions.DontRequireReceiver);
            }
        }
示例#27
0
        /// <inheritdoc />
        protected override void onChanged()
        {
            base.onChanged();

            targetPositionOverridden = false;

            if (transformedInvoker != null)
            {
                transformedInvoker.InvokeHandleExceptions(this, EventArgs.Empty);
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                SendMessageTarget.SendMessage(TRANSFORM_MESSAGE, this, SendMessageOptions.DontRequireReceiver);
            }
            if (UseUnityEvents)
            {
                OnTransform.Invoke(this);
            }
        }
示例#28
0
        /// <inheritdoc />
        protected override void touchesCancelled(IList <ITouch> touches)
        {
            base.touchesCancelled(touches);

            var length = touches.Count;

            if (touchCancelledInvoker != null)
            {
                for (var i = 0; i < length; i++)
                {
                    touchCancelledInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touches[i]));
                }
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                for (var i = 0; i < length; i++)
                {
                    SendMessageTarget.SendMessage(TOUCH_CANCELLED_MESSAGE, touches[i], SendMessageOptions.DontRequireReceiver);
                }
            }
        }
    /// <summary>

    /// Sets the selected item (based on index)

    /// </summary>

    public void SetSelectedItem()

    {
        if (index < 0 || index >= ItemList.Count)

        {
            index = 0;
        }

        if (index >= 0 && index < ItemList.Count)

        {
            selectedTextMesh.text = ItemList[index];

            selectedTextMesh.Commit();
        }

        else

        {
            selectedTextMesh.text = "";

            selectedTextMesh.Commit();
        }



        if (OnSelectedItemChange != null)
        {
            OnSelectedItemChange();
        }



        if (SendMessageTarget != null && SendMessageOnSelectedItemChangeMethodName.Length > 0)

        {
            SendMessageTarget.SendMessage(SendMessageOnSelectedItemChangeMethodName, this, SendMessageOptions.RequireReceiver);
        }
    }
示例#30
0
        /// <inheritdoc />
        protected override void touchesCancelled(IList <ITouch> touches)
        {
            base.touchesCancelled(touches);

            if ((State == GestureState.Began || State == GestureState.Changed) && activeTouches.Count == 0)
            {
                setState(GestureState.Ended);
            }

            var length = touches.Count;

            for (var i = 0; i < length; i++)
            {
                touchCancelledInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touches[i]));
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                for (var i = 0; i < length; i++)
                {
                    SendMessageTarget.SendMessage(TOUCH_CANCELLED_MESSAGE, touches[i], SendMessageOptions.DontRequireReceiver);
                }
            }
        }
示例#31
0
        /// <inheritdoc />
        protected override void touchesBegan(IList <ITouch> touches)
        {
            base.touchesBegan(touches);

            if (State == GestureState.Possible)
            {
                setState(GestureState.Began);
            }

            var length = touches.Count;

            for (var i = 0; i < length; i++)
            {
                touchBeganInvoker.InvokeHandleExceptions(this, new MetaGestureEventArgs(touches[i]));
            }
            if (UseSendMessage && SendMessageTarget != null)
            {
                for (var i = 0; i < length; i++)
                {
                    SendMessageTarget.SendMessage(TOUCH_BEGAN_MESSAGE, touches[i], SendMessageOptions.DontRequireReceiver);
                }
            }
        }
示例#32
0
    /// <summary>
    /// Sets the selected item (based on index)
    /// </summary>
    public void SetSelectedItem()
    {
        if (index < 0 || index >= ItemList.Count)
        {
            index = 0;
        }
        if (index >= 0 && index < ItemList.Count)
        {
            selectedTextMesh.text = ItemList[index];
            selectedTextMesh.Commit();
        }
        else
        {
            selectedTextMesh.text = "";
            selectedTextMesh.Commit();
        }

        if (OnSelectedItemChange != null)
        {
            OnSelectedItemChange();
        }

        if (SendMessageTarget != null && SendMessageOnSelectedItemChangeMethodName.Length > 0)
        {
            SendMessageTarget.SendMessage(SendMessageOnSelectedItemChangeMethodName, this, SendMessageOptions.RequireReceiver);
        }

        if (stateNotifier)
        {
            //LoadStateObj.SendMessage("LoadCities");
        }

        if (truckNoty)
        {
            LoadStateObj.SendMessage("TruckSwap", index + 1);
        }
    }
 /// <summary>
 /// 发送内容消息
 /// </summary>
 /// <param name="accountID">账号ID</param>
 /// <param name="target">发送目标信息</param>
 /// <param name="message">消息内容</param>
 /// <returns>操作结果</returns>
 public OperateStatus SendTextMessage(Guid accountID, SendMessageTarget target, string message)
 {
     SendMsgServiceModel model = new SendMsgServiceModel();
     return model.SendTextMessage(accountID, target, message);
 }
 public ServiceResult SendNewsMesaage(Guid accountID, SendMessageTarget target, IList<NewsSendItem> message)
 {
     SendMsgServiceModel model = new SendMsgServiceModel();
     var status = model.SendNewsMesaage(accountID, target, message);
     return new ServiceResult(status);
 }
示例#35
0
 public OperateStatus SendTextMessage(Account currentAccount, SendMessageTarget target, string message)
 {
     // ReSharper disable once PossibleInvalidOperationException
     var sendMsg = new SendMsg(currentAccount.AgentID.Value, target, message);
     return SendMessage(currentAccount, sendMsg);
 }
 /// <summary>
 /// 发送通知消息
 /// </summary>
 /// <param name="accountID">账号ID</param>
 /// <param name="target">发送目标信息</param>
 /// <param name="message">消息内容项</param>
 /// <returns>操作结果</returns>
 public OperateStatus SendNewsMesaage(Guid accountID, SendMessageTarget target, IList<NewsSendItem> message)
 {
     SendMsgServiceModel model = new SendMsgServiceModel();
     return model.SendNewsMesaage(accountID, target, message);
 }
 public ServiceResult SendTextMessage(Guid accountID, SendMessageTarget target, string message)
 {
     SendMsgServiceModel model = new SendMsgServiceModel();
     var status = model.SendTextMessage(accountID, target, message);
     return new ServiceResult(status);
 }