private void CalculatePacketLoss()
        {
            var lossCount = (double)PingReplies.Count(r => !r.IsSuccess);

            if (lossCount < 1)
            {
                LossPercentage = 0;
                return;
            }

            var allCount = (double)PingReplies.Count;

            LossPercentage = (int)((lossCount / allCount) * 100);
        }
        private void OnPingCompleted(object sender, PingCompletedEventArgs e)
        {
            if (PingReplies.Count() > MaxReply)
            {
                Dispatcher.Invoke(() => PingReplies.RemoveAt(PingReplies.Count - 1));
            }

            LastReply = new PingReplyWrapper(e.Reply);
            Dispatcher.Invoke(() => PingReplies.Insert(0, LastReply));

            CalculateAverage();
            CalculatePacketLoss();

            Task.Delay(PingInterval).ContinueWith(_ => { if (IsRunning)
                                                         {
                                                             StartPing();
                                                         }
                                                  });
        }