Example #1
0
		protected override string ProcessContent (string content, IStringTagModel tags)
		{
			using (var host = new FileTemplateHost (tags)) {
				string s = srcFile;
				string output;
				host.ProcessTemplate (s, content, ref s, out output);
				if (host.Errors.HasErrors) {
					foreach (var err in host.Errors)
						LoggingService.LogError ("Error in template generator: {0}", err.ToString());
					throw new Exception ("Failed to generate file");
				}
				return output;
			}
		}
		protected override string ProcessContent (string content, IStringTagModel tags)
		{
			using (var host = new FileTemplateHost (tags)) {
				string s = srcFile;
				string output;
				host.ProcessTemplate (s, content, ref s, out output);
				if (host.Errors.HasErrors) {
					foreach (var err in host.Errors)
						LoggingService.LogError ("Error in template generator: {0}", err.ToString());
					var firstError = host.Errors.OfType<CompilerError> ().First (f => !f.IsWarning);
					throw new Exception (GettextCatalog.GetString ("Failed to generate file: {0}", firstError.ErrorText));
				}
				return output;
			}
		}
Example #3
0
 protected override string ProcessContent(string content, IStringTagModel tags)
 {
     using (var host = new FileTemplateHost(tags)) {
         string s = srcFile;
         string output;
         host.ProcessTemplate(s, content, ref s, out output);
         if (host.Errors.HasErrors)
         {
             foreach (var err in host.Errors)
             {
                 LoggingService.LogError("Error in template generator: {0}", err.ToString());
             }
             throw new Exception("Failed to generate file");
         }
         return(output);
     }
 }
Example #4
0
 protected override string ProcessContent(string content, IStringTagModel tags)
 {
     using (var host = new FileTemplateHost(tags)) {
         string s = srcFile;
         string output;
         host.ProcessTemplate(s, content, ref s, out output);
         if (host.Errors.HasErrors)
         {
             foreach (var err in host.Errors)
             {
                 LoggingService.LogError("Error in template generator: {0}", err.ToString());
             }
             var firstError = host.Errors.OfType <CompilerError> ().First(f => !f.IsWarning);
             throw new Exception("Failed to generate file: " + firstError.ErrorText);
         }
         return(output);
     }
 }