Question

Need to add inherite to some interface using roslyn.
I describe the class, but don't know how to set inherite in the following structures:

ClassDeclarationSyntax lClassDeclarationSyntax =
Syntax.ClassDeclaration(
                    Syntax.List<AttributeListSyntax>(lAttributeListSyntax), 
                    Syntax.TokenList(lTokens), 
                    Syntax.Identifier(_classInfo.Identifier.ValueText), 
                    null,
                    null,---------
                    Syntax.List<TypeParameterConstraintClauseSyntax>(), 
                    Syntax.List<MemberDeclarationSyntax>(lMemberDeclarationSyntaxList));

Isolated "null" it is a place for List attributes by type BaseListSyntax, where i can specify the name of the inherited interface.
How i can do this?

Was it helpful?

Solution

Use something like: Syntax.BaseList(Syntax.ParseTypeName("MyBaseType") in place of the null above.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top