private void UpdateValues() { while (_sd.BufferSize > 0) { string line = _sd.ReadLine(); if (_receive != null) { _receive(line); } try { Dictionary <string, Dictionary <string, string> > reading = NmeaParser.Parse(line); foreach (string sentenceName in reading.Keys) { _currentValues[sentenceName] = reading[sentenceName]; } if (_enableLog) { //write to db } } catch { //TODO:bad line, what should we do? } } _update(); }