SND\eagleeyestudios_cp 9b842c7fd8 Content Compiler:
- Fixed some resource issues
- Implemented RecentProjects Feature
- Implemented build process
- Added a Logger implementation for BuildContent Class
- Added a displayable log to the MainWindow UI
- Fixed a bug that occured when adding files to the content root
- Trying to open a not existing project no longer throws an exception

ContentPipeline:
- Added missing property "Profile" to ContentProject
2012-09-09 15:44:49 +00:00

56 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace ANX.ContentCompiler.GUI
{
public class RecentProjects : List<String>
{
private static readonly string Path =
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + System.IO.Path.DirectorySeparatorChar + "ANX Content Compiler" + System.IO.Path.DirectorySeparatorChar + "recentProjects.ees";
public RecentProjects()
: base(10)
{
}
public void Save()
{
XmlWriter writer = XmlWriter.Create(Path,
new XmlWriterSettings
{
Encoding = Encoding.UTF8,
Indent = true,
NewLineHandling = NewLineHandling.Entitize
});
writer.WriteStartDocument();
writer.WriteStartElement("RecentProjects");
foreach (string project in this)
{
writer.WriteStartElement("ContentProject");
writer.WriteValue(project);
writer.WriteEndElement();
}
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
writer.Close();
}
public static RecentProjects Load()
{
var instance = new RecentProjects();
XmlReader reader = XmlReader.Create(Path);
while (!reader.EOF)
{
if (reader.Name == "ContentProject")
instance.Add(reader.ReadElementContentAsString());
reader.Read();
}
reader.Close();
return instance;
}
}
}