Пример #1
0
 /// <summary>
 /// Handles ths ping results
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnPingResult(object sender, PingerResultEventArgs e)
 {
     // display the status of the ping result
     if (e.TimedOut)
     {
         _textBoxOutput.AppendText("Request timed out.\n");
     }
     else
     {
         _textBoxOutput.AppendText(string.Format("Reply from {0}: bytes={1} time={2}ms\n", e.Destination.ToString(), e.BytesReceived, e.ElapsedMilliseconds));
     }
 }
Пример #2
0
 protected virtual void OnPingResult(object sender, PingerResultEventArgs e)
 {
     try
     {
         if (this.PingResult != null)
         {
             this.PingResult(sender, e);
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
     }
 }
Пример #3
0
		protected virtual void OnPingResult(object sender, PingerResultEventArgs e)
		{
			try
			{
				if (this.PingResult != null)
					this.PingResult(sender, e);
			}
			catch(Exception ex)
			{
				Debug.WriteLine(ex);
			}
		}
Пример #4
0
		/// <summary>
		/// Handles ths ping results
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnPingResult(object sender, PingerResultEventArgs e)
		{
			// display the status of the ping result
			if (e.TimedOut)
				_textBoxOutput.AppendText("Request timed out.\n");			
			else
				_textBoxOutput.AppendText(string.Format("Reply from {0}: bytes={1} time={2}ms\n", e.Destination.ToString(), e.BytesReceived, e.ElapsedMilliseconds));

		}