Example #1
0
 static void DoPing(ref Ping p)
 {
     var theform = new PingForm();
     var result = theform.ShowDialog();
     theform.Focus();
     if (result == System.Windows.Forms.DialogResult.OK)
     {
         p.Answer = theform.Tags;
         p.IsAnswered = true;
         Log(theform.Tags);
     }
 }
Example #2
0
 public void LogPing(Ping Response)
 {
     try
     {
         using (var fs = File.AppendText(OutputFileName))
         {
             fs.WriteLine(String.Format("{0} {1:80} [{2:yyyy.MM.dd H:mm:ss ddd}]", Response.ScheduledUnixTime, Response.Answer, Response.ScheduledTime));
         }
     }
     catch (FileNotFoundException e)
     {
         throw;
     }
 }
Example #3
0
 public void DisplayAndLogPing(Ping ping)
 {
     foreach (var ui in uis)
     {
         try
         {
             Ping response = ui.Prompt(ping);
             logger.LogPing(ping);
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #4
0
 public Ping Prompt(Ping p)
 {
     DoPing(ref p);
     return p;
 }