//回车键触发这个函数 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)); } }
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); }
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); }
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); }