Skip to content

Commit

Permalink
.NET: Add nested enums to reference assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Apr 6, 2024
1 parent 4ee4010 commit d752625
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions csharp-api/AssemblyGenerator/ClassGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,16 @@ public ClassGenerator(string className_, REFrameworkNET.TypeDefinition t_, REFra
nestedTypeName = nestedTypeName.Replace("file", "@file");
}

if (nestedT.IsEnum()) {
var nestedEnumGenerator = new EnumGenerator(nestedTypeName.Split('.').Last(), nestedT);

if (nestedEnumGenerator.EnumDeclaration != null) {
this.Update(this.typeDeclaration.AddMembers(nestedEnumGenerator.EnumDeclaration));
}

continue;
}

HashSet<REFrameworkNET.Method> nestedMethods = [];

foreach (var method in nestedT.Methods) {
Expand Down

0 comments on commit d752625

Please sign in to comment.