Exemple #1
0
        private static IChunkMerger[] GetChunkMergers(ChunkTree chunkTree, string defaultModel)
        {
            var modelType = ChunkHelper.GetModelTypeName(chunkTree, defaultModel);

            return(new IChunkMerger[]
            {
                new UsingChunkMerger(),
                new SetBaseTypeChunkMerger(modelType)
            });
        }
Exemple #2
0
        private InjectChunk TransformChunk(InjectChunk injectChunk)
        {
            var typeName = ChunkHelper.ReplaceTModel(injectChunk.TypeName, _modelType);

            if (typeName != injectChunk.TypeName)
            {
                return(new InjectChunk(typeName, injectChunk.MemberName)
                {
                    Start = injectChunk.Start,
                    Association = injectChunk.Association
                });
            }
            return(injectChunk);
        }
Exemple #3
0
        /// <inheritdoc />
        public void VisitChunk(Chunk chunk)
        {
            if (chunk == null)
            {
                throw new ArgumentNullException(nameof(chunk));
            }

            var injectChunk = chunk as InjectChunk;

            if (injectChunk != null)
            {
                injectChunk.TypeName = ChunkHelper.ReplaceTModel(injectChunk.TypeName, _modelType);
                _addedMemberNames.Add(injectChunk.MemberName);
            }
        }
Exemple #4
0
        private SetBaseTypeChunk TransformChunk(SetBaseTypeChunk setBaseTypeChunk)
        {
            var typeName = ChunkHelper.ReplaceTModel(setBaseTypeChunk.TypeName, _modelType);

            if (typeName != setBaseTypeChunk.TypeName)
            {
                return(new SetBaseTypeChunk
                {
                    TypeName = typeName,
                    Start = setBaseTypeChunk.Start,
                    Association = setBaseTypeChunk.Association
                });
            }
            return(setBaseTypeChunk);
        }
Exemple #5
0
        /// <inheritdoc />
        public void VisitChunk(Chunk chunk)
        {
            if (chunk == null)
            {
                throw new ArgumentNullException(nameof(chunk));
            }

            var setBaseTypeChunk = chunk as SetBaseTypeChunk;

            if (setBaseTypeChunk != null)
            {
                setBaseTypeChunk.TypeName = ChunkHelper.ReplaceTModel(setBaseTypeChunk.TypeName, _modelType);
                _isBaseTypeSet            = true;
            }
        }