예제 #1
0
        public virtual void CompileViews()
        {
            var result = CreateFileInfoCollection();

            if (result != null)
            {
                var collectionGenerator = new RazorFileInfoCollectionGenerator(
                    result,
                    CompilationSettings);

                var tree = collectionGenerator.GenerateCollection();
                CompileContext.Compilation = CompileContext.Compilation.AddSyntaxTrees(tree);
            }
        }
예제 #2
0
        public virtual void CompileViews([NotNull] IBeforeCompileContext context)
        {
            var descriptors = CreateCompilationDescriptors(context);

            if (descriptors.Any())
            {
                var collectionGenerator = new RazorFileInfoCollectionGenerator(
                    descriptors,
                    CompilationSettings);

                var tree = collectionGenerator.GenerateCollection();
                context.CSharpCompilation = context.CSharpCompilation.AddSyntaxTrees(tree);
            }
        }
예제 #3
0
        public virtual void CompileViews([NotNull] IBeforeCompileContext context)
        {
            var descriptors = CreateCompilationDescriptors(context);

            if (descriptors.Count > 0)
            {
                var collectionGenerator = new RazorFileInfoCollectionGenerator(
                    descriptors,
                    SyntaxTreeGenerator.GetParseOptions(context.CSharpCompilation));

                var tree = collectionGenerator.GenerateCollection();
                context.CSharpCompilation = context.CSharpCompilation.AddSyntaxTrees(tree);
            }
        }