private void WriteProfileListToDataFile() { XmlSerializer xmlSerializer = new XmlSerializer(profileCollection.GetType()); string dataFilePath = Path.Combine(GetAppDataFolder(), DATA_FILE); using (TextWriter writer = new StreamWriter(dataFilePath)) { xmlSerializer.Serialize(writer, profileCollection); } }
private void InitDataFile(string dataFilePath) { profileCollection = new ProfileCollection(); XmlSerializer xmlSerializer = new XmlSerializer(profileCollection.GetType()); using (TextWriter writer = new StreamWriter(dataFilePath)) { xmlSerializer.Serialize(writer, profileCollection); } }