Example #1
0
        //#region 设置当前答题流程答案
        ///// <summary>
        ///// 设置当前答题流程答案
        ///// </summary>
        ///// <param name="command"></param>
        ///// <param name="result"></param>
        //public void SetFlowAnswers(Flows.FlowCommand command, string result)
        //{
        //    if (FlowAnswers.ContainsKey(command))
        //    {
        //        FlowAnswers[command] = result;
        //    }
        //    else
        //    {
        //        FlowAnswers.Add(command, result);
        //    }
        //}
        //#endregion

        #region 向设备发送文本内容
        /// <summary>
        /// 向设备发送文本内容
        /// </summary>
        /// <param name="text"></param>
        public void SendText(string text, bool isTcp)
        {
            if (!isTcp)
            {
                var ret = CheckDeviceBind();
                if (ret == false) return;
            }

            var pack = PackHelper.CreateSend(this.mDeviceId);
            var datas = pack.SendTextPack(text, isTcp);
            if (isTcp)
            {
                PenController.Instance.PendSend(datas, this.mTcpClient);
            }
            else if (this.mIpAddress != null)
            {
                PenController.Instance.PendSend(datas, this.mIpAddress);
            }
        }