Example #1
0
 protected void OnNextPingResult(PingResult pr)
 {
     var label = pr.TimeStamp.ToString("mm:ss");
     var time = (int)pr.RoundtripTime;
     this.PushRoundtripItem(label, time);
     this.UpdateVisualizers(pr);
     this.RaisePropertyChanged(() => this.ElapsedTime);
 }
Example #2
0
 protected PingResult ExecPing(long ping_count)
 {
     var sw = new Stopwatch();
     sw.Start();
     var result = new PingResult(_ping.Send(_target, this.PingTimeout, _data, _pingOptions));
     sw.Stop();
     result.InjectRoudTripTime(sw.Elapsed);
     return result;
 }
Example #3
0
 public void UpdateVisualizers(PingResult result)
 {
     this.StateColor = this.GetScoreColor(this.RoundtripScore);
     this.SignalLevel = Math.Max(5 - (int)Math.Floor(this.RoundtripScore / 10), 0);
 }