private void AddLoadedHost(object hostNode) { try { HostPinger hp = new HostPinger((XmlNode)hostNode); hp.Logger = DefaultLogger.Instance; hp.OnPing += new OnPingDelegate(OnHostPing); hp.OnStopPinging += new OnHostPingerCommandDelegate(hp_OnStopPinging); hp.OnStartPinging += new OnHostPingerCommandDelegate(hp_OnStartPinging); HostDataSeries series = new HostDataSeries(this, hp); series.LoadSettings((XmlNode)hostNode); lock (_hosts) { _hosts.Add(hp); _dataSeries.Add(hp, series); // _graphManager.RegisterSeries(series); } if (Options.Instance.StartPingingOnProgramStart) { hp.Start(); } } catch (Exception ex) { if (Options.Instance.ShowErrorMessages) { MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void _tbStartHost_Click(object sender, EventArgs e) { if (_selectedPinger != null) { _selectedPinger.Start(); } }