public async void StopButtonClicked(object sender, EventArgs e) { var botResponse = await _botService.SendStopConversation(CurrentUser); ConversationList.Add(botResponse); CheckMessage.Text = JsonConvert.SerializeObject(botResponse); }
private async Task SendMessage() { ProgressVisible = true; var botResponse = await _botConnector.SendMessage("Daniel", Message.Text); ProgressVisible = false; ConversationList.Add(botResponse); }
private async Task SendMessage() { ProgressVisible = true; ConversationList.Add(new BotMessage() { From = "Me", Text = Message.Text }); var botResponse = await _botConnector.SendMessage("Me", Message.Text); ProgressVisible = false; ConversationList.Add(botResponse); }
public void NotifyMe(NotificationMessage notificationMessage) { string notification = notificationMessage.Notification; ConversationList.Clear(); _history = new History(); foreach (var item in _history.Histories) { ConversationList.Add(item); } FilterCollection(); }
private void ParseConversations() { String args = String.Format("{0} \"{1}\" {2} {3} {4} {3} {5} {3} {6} {3} {7} {8} \"{9}.{10}\"", TSharkHelper.ARG_READ_FILE, NetworkTrace.FullName, TSharkHelper.FILTER_FIELDS, TSharkHelper.FIELD, TSharkHelper.FIELD_REQUEST_IN, TSharkHelper.FIELD_FRAME_NUMBER, TSharkHelper.FIELD_MAC_DST, TSharkHelper.FIELD_MAC_SRC, TSharkHelper.ARG_DISPLAY_FILTER, CTTSettings.PROTOCOL_HTTP, CTTSettings.FILTER_RESPONSE); String output; if (!TSharkHelper.RunTShark(args, out output)) { return; } var detectedDevices = FrameList.GetDevices(); String[] lines = output.SplitToLines(); foreach (String[] parts in lines.Select(line => line.Split(TSharkHelper.OUTPUT_SEPARATOR))) { int requestFrameNumber; int responseFrameNumber; int.TryParse(parts[0], out requestFrameNumber); // 0 as default value if TryParse failed if (0 == requestFrameNumber) { continue; } int.TryParse(parts[1], out responseFrameNumber); String clientMac = parts[2]; String deviceMac = parts[3]; Unit client = UnitSet.GetUnit(clientMac); if (null == client) { var macIpPair = detectedDevices.First(item => item.Item1 == clientMac); client = new Client(NetworkTrace, macIpPair.Item1, macIpPair.Item2); UnitSet.Add(client); } else { client.FoundInTraces.Add(NetworkTrace); } Unit device = UnitSet.GetUnit(deviceMac); if (null == device) { var macIpPair = detectedDevices.First(item => item.Item1 == deviceMac); device = new Device(NetworkTrace, macIpPair.Item1, macIpPair.Item2); UnitSet.Add(device); } else { device.FoundInTraces.Add(NetworkTrace); } var conversation = ConversationList.Find(client, device); if (null == conversation) { conversation = new Conversation(NetworkTrace, client, device); ConversationList.Add(conversation); } conversation.FoundInTraces.Add(NetworkTrace); Directory.CreateDirectory(ConversationHelper.GetConversationFolder(NetworkTrace, conversation)); var request = new HttpRequest(FrameList.GetFrame(requestFrameNumber), conversation); var response = new HttpResponse(FrameList.GetFrame(responseFrameNumber), conversation); conversation.Add(new RequestResponsePair(request, response, NetworkTrace, conversation, ContentType.Http)); } }