36 lines
956 B
C#
36 lines
956 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml;
|
|
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 (XmlWriter xmlWriter = XmlWriter.Create(filename))
|
|
{
|
|
XmlSerializer xmls = new XmlSerializer(typeof(UserSettings));
|
|
xmls.Serialize(xmlWriter, this);
|
|
}
|
|
}
|
|
public UserSettings Read(string filename)
|
|
{
|
|
using (StreamReader sw = new StreamReader(filename))
|
|
{
|
|
XmlSerializer xmls = new XmlSerializer(typeof(UserSettings));
|
|
return xmls.Deserialize(sw) as UserSettings;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|