private void PollingTimerEllapsed(object sender, ElapsedEventArgs e) { try { if (_isPollingCancelled) { _pointsToPoll = null; } else { _pointsToPoll.Read(); ReadCount++; } } catch (Exception ex) { AddLogEntry(ex.Message); ErrorCount++; } finally { if (!_isPollingCancelled && _pointsToPoll != null) { _pollingTimer.Start(); } } }