Example #1
0
        public TemplateFactory Compile(ViewSourceReader viewSourceReader, TemplateOptions options, TemplateClassBuilder builder)
        {
            var templateSource = builder.Build(options.Usings);

            var typeBuilder = new BooTemplateTypeBuilder(options);

            var templateType = typeBuilder.Build(templateSource, builder.ClassName);

            if( templateType == null )
            {
                var path = ListExtensions.Last(viewSourceReader.ViewSources).Path;
                TemplateCompilationException.Throw( typeBuilder.CompilerResults,typeBuilder.Source, path );
            }

            return new TemplateFactory( templateType );
        }
Example #2
0
        public TemplateFactory Compile(ViewSourceReader viewSourceReader, TemplateOptions options, TemplateClassBuilder builder)
        {
            var templateSource = builder.Build(options.Usings);

            var typeBuilder = new BooTemplateTypeBuilder(options);

            var templateType = typeBuilder.Build(templateSource, builder.ClassName);

            if (templateType == null)
            {
                var path = ListExtensions.Last(viewSourceReader.ViewSources).Path;
                TemplateCompilationException.Throw(typeBuilder.CompilerResults, typeBuilder.Source, path);
            }

            return(new TemplateFactory(templateType));
        }