Use something like: Syntax.BaseList(Syntax.ParseTypeName("MyBaseType")
in place of the null
above.
How to work with BaseListSyntax, Roslyn
题
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?
解决方案
不隶属于 StackOverflow