public void Log(HostPinger host, string message) { PingForm.NotifyMessage(host, message); lock (this) { _fileWriter.WriteLine(LOG_ROW_FORMAT, DateTime.Now, host.HostIP, host.HostName, message); _fileWriter.Flush(); } }
public static void NotifyMessage(HostPinger host, string message) { if (Application.OpenForms.Count > 0) { PingForm frm = ((PingForm)Application.OpenForms[0]); if (frm != null) { frm._notifyIcon.ShowBalloonTip(10000, host.HostName + "(" + host.HostIP.ToString() + ")", message, ToolTipIcon.Info); } } }