public void Save(string filename)
{
Directory.CreateDirectory(Path.GetDirectoryName(filename));
var xml = new XDocument(
new XElement(XmlRootName,
new XAttribute(XmlAttrName, Name),
new XAttribute(XmlAttrSlideDuration, SlideSeconds),
new XAttribute(XmlAttrTransitionDuration, TransitionSeconds)));
if (FindAPhotoHost != null)
{
logger.Info("Handle saving host: {0}", FindAPhotoHost);
// xml.Root.FirstNode.
// new XAttribute(XmlAttrFindAPhotoHost, FindAPhotoHost)));
}
foreach (var fm in FolderList)
{
xml.Root.Add(
new XElement("folder",
new XAttribute("path", fm.Path)));
}
if (Search != null)
{
xml.Root.Add(
new XElement("search",
new XAttribute("query", Search)));
}
filename = EnsureExtension(filename);
File.WriteAllText(filename, xml.ToString());
this.Filename = filename;
}