示例#1
0
 //回车键触发这个函数
 public void ToSendText(string text)
 {
     text.Trim();
     if (this.toggle.isOn)
     {
         if (text.Length > 0)
         {
             var strs = text.Split(' ');
             if (strs.Length != 2 || int.Parse(strs[1]) == null)
             {
                 //层层封装后,服务器和客户端之间发送消息,就可以这样简单
                 MessageMgr.Q_SendText(text);
                 //MessageMgr.SendObject(MessageData.Init(new MessageData(), text, UserName));
             }
             else
             {
                 MessageMgr.SendMessage(SocketNetWork.udpClientSocket, text, SocketNetWork.udpServerEnd);
                 //MessageMgr.SendObject(MessageData.Init(new MessageData(), Convert.ToInt32(strs[0]), Convert.ToInt32(strs[1]), UserName));
             }
         }
     }
     else
     {
         //MessageMgr.SendMessage(SocketNetWork.udpClientSocket, text, SocketNetWork.udpServerEnd);
         MessageMgr.SendObject(SocketNetWork.tcpServerSocket, MessageData.Init(text, MessageType.Merge, UserName));
     }
 }
示例#2
0
文件: Item.cs 项目: zqbb/MxDebug
 private void OnClickButton()
 {
     UserModel.SelectionIndex = index;
     MessageMgr.SendMessage(Define.GLOBAL_MESSAGE_TYPE, Define.ON_SELECTION_MSG, debugData.ID);
     UIManager.Instance.OpenUIForms(EnumUIFormType.SelectMsgUIForm);
     MessageMgr.SendMessageToUIForm(EnumUIFormType.SelectMsgUIForm, "Info", debugData.Condition + "\n" + debugData.StackTrace);
 }
示例#3
0
    private void OnClickMsg()
    {
        if (latestMsgInfo == null)
        {
            return;
        }

        DebugData debugData = DebugDataManager.Instance.GetDataByIndex(latestMsgInfo.Index);

        if (debugData == null)
        {
            return;
        }

        UserModel.SelectionIndex = latestMsgInfo.Index;
        UIManager.Instance.OpenUIForms(EnumUIFormType.SelectMsgUIForm);

        MessageMgr.SendMessageToUIForm(EnumUIFormType.SelectMsgUIForm, "Info", debugData.Condition + "\n" + debugData.StackTrace);
        MessageMgr.SendMessageToUIForm(EnumUIFormType.AllMsgUIForm, Define.ON_ALL_MSG_UI_MOVE_TO_INDEX, latestMsgInfo.Index);
        MessageMgr.SendMessage(Define.GLOBAL_MESSAGE_TYPE, Define.ON_SELECTION_MSG, debugData.ID);
    }
示例#4
0
    private void AddCurrentData(string key, DebugData debugData)
    {
        switch (collapseState)
        {
        case CollapseState.Fold:

            if (!dicCurrentData.ContainsKey(key))
            {
                AddCount(debugData.Type);

                if (IsAddCurrentData(debugData.Type))
                {
                    dicCurrentData.Add(key, debugData);
                    AddLatestMsg(key, debugData.Condition, debugData.Type);
                }
            }
            else
            {
                if (IsAddCurrentData(debugData.Type))
                {
                    dicCurrentData[key].Count++;
                    AddLatestMsg(key, debugData.Condition, debugData.Type);
                }
            }
            break;

        case CollapseState.Expand:

            AddCount(debugData.Type);

            if (IsAddCurrentData(debugData.Type))
            {
                dicCurrentData.Add(key, debugData);
                AddLatestMsg(key, debugData.Condition, debugData.Type);
            }
            break;
        }

        MessageMgr.SendMessage(Define.GLOBAL_MESSAGE_TYPE, Define.ON_ADDDATA, key);
    }