6public class EnumExporter(INamedTypeSymbol symbol) :
IExporter
8 public void GenerateUnmanagedCode(IndentedTextWriter source, IndentedTextWriter header)
10 header.WriteLine($
"namespace {symbol.ContainingNamespace.ToDisplayString().Replace(".
", "::
")}");
11 header.WriteLine(
"{");
13 header.WriteLine($
"enum {symbol.Name} : {symbol.EnumUnderlyingType!.ToDisplayString()}");
14 header.WriteLine(
"{");
17 foreach (var entry
in symbol.GetMembers().OfType<IFieldSymbol>())
18 header.WriteLine($
"{entry.Name} = {entry.ConstantValue!}");
21 header.WriteLine(
"};");
23 header.WriteLine(
"}");
26 public void GenerateManagedCode(IndentedTextWriter builder)