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); } }
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; } }
public void DisplayAndLogPing(Ping ping) { foreach (var ui in uis) { try { Ping response = ui.Prompt(ping); logger.LogPing(ping); } catch (Exception) { throw; } } }
public Ping Prompt(Ping p) { DoPing(ref p); return p; }