private void sensor_StatusForecast(object sender, StatusForecastEventArgs e) { var sensorsWithReceiveStatusForecastSupport = _sensors.Where(x => x as IReceiveStatusForecast != null).Select(x => (IReceiveStatusForecast)x).ToList(); foreach (var sensor in sensorsWithReceiveStatusForecastSupport) { bool sensorIsSender = sender.GetType().Name == sensor.GetType().Name; if (!sensorIsSender) { sensor.OnStatusForecast(sender, e); } } }
public void OnStatusForecast(object sender, StatusForecastEventArgs e) { _trayIcon.ShowStatusForecastBalloonTip(e.Socket, e.Status, e.CountDown, sender.GetType().Name); }