KaraokePC/SingsALot/Classes/UserSettings.cs
Matt Bruce e90160c56d added windows launch app
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
2017-12-12 08:51:12 -06:00

35 lines
927 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace SingsALot.Classes
{
public class UserSettings
{
public string controllerName { get; set; }
public string songsLocationPath { get; set; }
public void Save(string filename)
{
using (StreamWriter sw = new StreamWriter(filename))
{
XmlSerializer xmls = new XmlSerializer(typeof(UserSettings));
xmls.Serialize(sw, this);
}
}
public UserSettings Read(string filename)
{
using (StreamReader sw = new StreamReader(filename))
{
XmlSerializer xmls = new XmlSerializer(typeof(UserSettings));
return xmls.Deserialize(sw) as UserSettings;
}
}
}
}