public void SaveUIDState() { using (TextWriter stateWriter = new StreamWriter(_UIDStateFile)) { UIDState state = new UIDState(); state.UIDValidity = _UIDValidity; state.HighestUIDRead = _HighestUIDRead; state.LowestUIDRead = _LowestUIDRead; _UIDStateSerializer.Serialize(stateWriter, state); } }
public void LoadUIDState() { _UIDStateKnown = false; if (File.Exists(_UIDStateFile)) { using (TextReader stateReader = new StreamReader(_UIDStateFile)) { UIDState state = (UIDState)_UIDStateSerializer.Deserialize(stateReader); _UIDValidity = state.UIDValidity; _HighestUIDRead = state.HighestUIDRead; _LowestUIDRead = state.LowestUIDRead; _UIDStateKnown = true; } } }