Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        private void InitDataFile(string dataFilePath)
        {
            profileCollection = new ProfileCollection();
            XmlSerializer xmlSerializer = new XmlSerializer(profileCollection.GetType());

            using (TextWriter writer = new StreamWriter(dataFilePath))
            {
                xmlSerializer.Serialize(writer, profileCollection);
            }
        }