Ejemplo n.º 1
0
 static void ApplyTemplate(ApiModel item, string outputDirectory, TemplateEngine templateEngine, string templateName)
 {
     var outputPath = Path.Combine(outputDirectory, TemplateCallbacks.GetApiClassName(item) + ".cs");
     if (File.Exists(outputPath))
         File.Delete(outputPath);
     File.WriteAllText(outputPath, templateEngine.ApplyByName(templateName, item));
 }
Ejemplo n.º 2
0
        static void ApplyTemplate(ApiModel item, string outputDirectory, TemplateEngine templateEngine, string templateName)
        {
            var outputPath = Path.Combine(outputDirectory, TemplateCallbacks.GetApiClassName(item) + ".cs");

            if (File.Exists(outputPath))
            {
                File.Delete(outputPath);
            }
            File.WriteAllText(outputPath, templateEngine.ApplyByName(templateName, item));
        }
Ejemplo n.º 3
0
 static void ApplyTemplate(IEnumerable<TypeModel> items, string outputDirectory, TemplateEngine templateEngine, string templateName)
 {
     foreach (var item in items)
     {
         var outputPath = Path.Combine(outputDirectory, item.Name + ".cs");
         if (File.Exists(outputPath))
             File.Delete(outputPath);
         File.WriteAllText(outputPath, templateEngine.ApplyByName(templateName, item));
     }
 }
Ejemplo n.º 4
0
 static void ApplyTemplate(IEnumerable <TypeModel> items, string outputDirectory, TemplateEngine templateEngine, string templateName)
 {
     foreach (var item in items)
     {
         var outputPath = Path.Combine(outputDirectory, item.Name + ".cs");
         if (File.Exists(outputPath))
         {
             File.Delete(outputPath);
         }
         File.WriteAllText(outputPath, templateEngine.ApplyByName(templateName, item));
     }
 }