public static void Generate(StringBuilder buffer, ClrEnum clrEnum) { if (buffer == null) { throw new ArgumentNullException(nameof(buffer)); } if (clrEnum == null) { throw new ArgumentNullException(nameof(clrEnum)); } buffer.Append(GetAccessLevel(clrEnum.AccessLevel)); buffer.Append(' '); buffer.Append(@"enum"); buffer.Append(' '); buffer.AppendLine(clrEnum.Name); buffer.AppendLine(@"{"); foreach (var entry in clrEnum.Entries) { buffer.Append('\t'); buffer.Append(entry.Name); buffer.Append(','); buffer.AppendLine(); } buffer.Append(@"}"); }
public static string Generate(ClrEnum clrEnum) { if (clrEnum == null) { throw new ArgumentNullException(nameof(clrEnum)); } var buffer = new StringBuilder(); Generate(buffer, clrEnum); return(buffer.ToString()); }