/// <summary> /// Saves the PersonList data /// </summary> public static void SaveData() { string path = Path.Combine(Path.GetTempPath(), FILENAME); if (m_Data == null) { m_Data = new PersonList(); } string ser = Serialize(m_Data); File.WriteAllText(path, ser); }
/// <summary> /// Loads the PersonList from a file /// </summary> /// <returns>PersonList data</returns> public static PersonList LoadData() { string path = Path.Combine(Path.GetTempPath(), FILENAME); if (m_Data == null && File.Exists(path)) { string ser = File.ReadAllText(path); m_Data = Deserialize <PersonList>(ser); } if (m_Data == null) { m_Data = new PersonList(); } return(m_Data); }