Exemple #1
0
 public static string GetFileName <T, M>(this T template, ISourceFileMapRepository <T, M> sourceFileMap, string fileName) where T : ITemplate <M> where M : TemplateDataModel
 {
     template.DataModel._Template = new FileModel()
     {
         CodeName        = fileName,
         Extension       = sourceFileMap.GetSourceExtension(template),
         ProjectFilePath = sourceFileMap.GetSourcePath(template)
     };
     return(template.DataModel._Template.FileName);
 }
Exemple #2
0
        public bool WriteTemplateToFile <T>(T template, ISourceFileMapRepository <T, M> mapRepository)
            where T : ITemplate <M>
        {
            var templateOutput = template.TransformText();
            var fullName       = mapRepository.GetSourcePath(template) + template.GetFileName();
            var hasWritten     = _FileService.WriteFileToDisk(fullName, templateOutput);

            _ProjectFactory.UpdateProjectFileWithFileReference <M>(template);

            return(hasWritten);
        }
 public void WriteTemplateWithModelInjection <I>(I template, ISourceFileMapRepository <I, M> sourceFileRepo)
     where I : ITemplate <M>
 {
     _Repository.WriteTemplateToFile(template, sourceFileRepo);
 }