예제 #1
0
        private string CreateFile(TypeInfo type, string templateName, string className,
                                  bool markAsGenerated)
        {
            var relativeName = Path.Combine(GetPackageDir(type),
                                            className + (markAsGenerated ? ".generated" : "") + ".cs");
            var fullname = Path.Combine(BaseOutputPath, relativeName);

            Directory.CreateDirectory(Path.Combine(BaseOutputPath, GetPackageDir(type)));

            TemplateWrapper template = new TemplateWrapper(templateName);

            template.StartSession();
            template.SetAttribute("it", type);
            template.SetAttribute("class", className);

            File.WriteAllText(fullname, template.Render());
//			FormatFileWithNArranger(fullname);
            FormatFileWithAStyle(fullname);

            log.Info("Created file " + relativeName);

            return(relativeName);
        }
예제 #2
0
		private string CreateFile(TypeInfo type, string templateName, string className,
		                          bool markAsGenerated)
		{
			var relativeName = Path.Combine(GetPackageDir(type),
			                                className + (markAsGenerated ? ".generated" : "") + ".cs");
			var fullname = Path.Combine(BaseOutputPath, relativeName);

			Directory.CreateDirectory(Path.Combine(BaseOutputPath, GetPackageDir(type)));

			TemplateWrapper template = new TemplateWrapper(templateName);
			template.StartSession();
			template.SetAttribute("it", type);
			template.SetAttribute("class", className);

			File.WriteAllText(fullname, template.Render());
//			FormatFileWithNArranger(fullname);
			FormatFileWithAStyle(fullname);

			log.Info("Created file " + relativeName);

			return relativeName;
		}