private void SendPackageDisplayAreaAutoClear(object sender, RoutedEventArgs e)
 {
     //超过10MB就自动清除。
     if (TxtSendBytes.Text.Length > 10485760)
     {
         TxtSendBytes.Clear();
     }
 }
 private void SendPreparedBytes()
 {
     if (!BinFileHelper.SendBytesPrepared)
     {
         LblMessages.Content = $"小姐姐们还没准备好!事情是这样的:{BinFileHelper.GetOperateMessage()}。时间:{DateTime.Now:HH:mm:ss fff}";
         return;
     }
     if (!SerialPortHelper.SendBytes(BinFileHelper.GetPreparedBytes()))
     {
         LblMessages.Content = $"发送失败了,你猜是为什么?消息是这样的:{SerialPortHelper.LastException()}。时间:{DateTime.Now:HH:mm:ss fff}";
         return;
     }
     TxtSendBytes.AppendText(BinFileHelper.GetPreparedString() + "\r\n\r\n");
     TxtSendBytes.ScrollToEnd();
     LblSendedBytesCount.Content = BinFileHelper.CountAlreadySend().ToString();
     LblWaitForSend.Content      = BinFileHelper.CountExisted().ToString();
     BinFileHelper.PrepareNextBytes();
     DisplayPreparedPackageString();
 }
 private void ClearSendPackageDisplayArea(object sender, RoutedEventArgs e) => TxtSendBytes.Clear();