forked from SharpGenTools/SharpGenTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroupCodeGenerator.cs
More file actions
29 lines (25 loc) · 1.01 KB
/
Copy pathGroupCodeGenerator.cs
File metadata and controls
29 lines (25 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using SharpGen.Model;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
namespace SharpGen.Generator;
internal sealed class GroupCodeGenerator : MemberSingleCodeGeneratorBase<CsGroup>
{
public GroupCodeGenerator(Ioc ioc) : base(ioc)
{
}
public override MemberDeclarationSyntax GenerateCode(CsGroup csElement)
{
var list = NewMemberList;
list.AddRange(csElement.ExpressionConstants, Generators.ExpressionConstant);
list.AddRange(csElement.GuidConstants, Generators.GuidConstant);
list.AddRange(csElement.ResultConstants, Generators.ResultConstant);
list.AddRange(csElement.Functions, Generators.Function);
return AddDocumentationTrivia(
ClassDeclaration(Identifier(csElement.Name))
.WithModifiers(csElement.VisibilityTokenList.Add(Token(SyntaxKind.PartialKeyword)))
.WithMembers(List(list)),
csElement
);
}
}