public override void AddFileFromTemplate(string source, string target)
{
if(!File.Exists(source))
{
throw new FileNotFoundException(string.Format("Template file not found: {0}", source));
}
// The class name is based on the new file name
string className = Path.GetFileNameWithoutExtension(target);
this.FileTemplateProcessor.GetFileNamespace(target, this);
try
{
this.FileTemplateProcessor.UntokenFile(source, target);
this.FileTemplateProcessor.Reset();
}
catch(Exception e)
{
throw new FileLoadException("Failed to add template file to project", target, e);
}
}
#endregion