private void LoadSession() { var serializer = new JsonSerializer(); Directory.CreateDirectory(confFolder); try { using (var file = new StreamReader(sessionFile)) using (var reader = new JsonTextReader(file)) { session = serializer.Deserialize<Session>(reader); } } catch(FileNotFoundException) { // No problem. session = null; } }
public void PutSession(Session s) { session = s; SaveSession(); }