Ejemplo n.º 1
0
        private void UpdateCodeBuilder(CodeGeneratorContext context)
        {
            var chunkUtility = new ChunkInheritanceUtility(context.CodeTreeBuilder.CodeTree,
                                                           DefaultInheritedChunks,
                                                           DefaultModel);
            var inheritedChunks = chunkUtility.GetInheritedChunks(this, _fileSystem, context.SourceFile);

            chunkUtility.MergeInheritedChunks(inheritedChunks);
        }
Ejemplo n.º 2
0
        public CodeGenerator DecorateCodeGenerator(CodeGenerator incomingGenerator, CodeGeneratorContext context)
        {
            var inheritedChunkTrees = GetInheritedChunkTrees(context.SourceFile);

            ChunkInheritanceUtility.MergeInheritedChunkTrees(
                context.ChunkTreeBuilder.ChunkTree,
                inheritedChunkTrees,
                _host.DefaultModel);

            return(new MyCSharpCodeGenerator(
                       context,
                       _host.DefaultModel,
                       _host.InjectAttribute,
                       new GeneratedTagHelperAttributeContext
            {
                ModelExpressionTypeName = _host.ModelExpressionType,
                CreateModelExpressionMethodName = _host.CreateModelExpressionMethod
            }));
        }