public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
        {
            var typesList = new List<TypeSyntax> { _baseTypeSyntax };

            if (node.BaseList != null)
                typesList.AddRange(node.BaseList.Types);

            var types = new SeparatedSyntaxList<TypeSyntax>();
            types = types.AddRange(typesList);

            var identifier = SyntaxFactory.Identifier(FurnaceTypeIdentifier + _typeName);

            var newNode = node.Update(
                node.AttributeLists,
                node.Modifiers,
                node.Keyword,
                identifier,
                node.TypeParameterList,
                SyntaxFactory.BaseList(types),
                node.ConstraintClauses,
                node.OpenBraceToken,
                node.Members,
                node.CloseBraceToken,
                node.SemicolonToken).NormalizeWhitespace();

            return base.VisitClassDeclaration(newNode);
        }
Beispiel #2
0
            public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
            {
                var tt = SyntaxFactory.ParseTypeName(_baseClass);

                var typesList = new List<TypeSyntax> { tt };
                typesList.AddRange(node.BaseList.Types);

                var types = new SeparatedSyntaxList<TypeSyntax>();
                types = types.AddRange(typesList);

                //SyntaxFactory.BaseList();
                var updated = node.Update(node.AttributeLists,
                    node.Modifiers,
                    node.Keyword,
                    node.Identifier,
                    node.TypeParameterList,
                    SyntaxFactory.BaseList(types),
                    node.ConstraintClauses,
                    node.OpenBraceToken,
                    node.Members,
                    node.CloseBraceToken,
                    node.SemicolonToken).NormalizeWhitespace();

                return updated;
            }