private void NoticeTcpConnect(bool arg, TcpClientViewModel model) { var findItem = TcpViewModel.FirstOrDefault(o => o.Id == model.Id); findItem.IsConnected = model.IsConnected; findItem.MessageText += model.IsConnected == true ? "TCP连接成功!\n" : "TCP连接断开!\n"; findItem.BtnIsEnabled = model.IsConnected == true ? false : true; }
private void NoticeTcpData(TcpClientViewModel model) { var findItem = TcpViewModel.FirstOrDefault(o => o.Id == model.Id); findItem.CurrentSize = model.DataSize; findItem.IsBegin = true; findItem.RateText = string.Format("速率{0}MB/s", (model.DataSize / 1048576.0).ToString("f2")); // findItem.DataSize += model.DataSize; }