public static PingLogger Instance() { if (instance == null) { instance = new PingLogger(); } return(instance); }
public Pinger(string IPadress) { address = IPAddress.Parse(IPadress); BackgroundWorker BW = new BackgroundWorker(); BW.WorkerSupportsCancellation = true; BW.DoWork += new DoWorkEventHandler(BW_doWork); pingSender.PingCompleted += new PingCompletedEventHandler(ping_Complete); Attach(PingLogger.Instance()); if (!BW.IsBusy) { BW.RunWorkerAsync(); } }