private static void AddEnum(
            this CodeBuilder builder,
            EnumDefinition enumDefinition,
            StorageType storageType,
            CurlyBracketMode curlyBracketMode)
        {
            var assemblyName = typeof(CSharpExporter).Assembly.GetName();

            if (!string.IsNullOrEmpty(enumDefinition.Comment))
            {
                builder.AddSummary(enumDefinition.Comment);
            }
            builder.WriteLine($"[GeneratedCode(\"{assemblyName.Name}\", \"{assemblyName.Version}\")]");
            if (storageType == StorageType.Implicit)
            {
                builder.Write($"public enum {enumDefinition.Identifier}");
            }
            else
            {
                builder.Write($"public enum {enumDefinition.Identifier} : {storageType.GetCSharpKeyword()}");
            }
            builder.StartScope(curlyBracketMode);

            var newlineBetweenEntries = enumDefinition.HasAnyEntryComments;
            var first = true;

            foreach (var entry in enumDefinition.Entries)
            {
                if (!first && newlineBetweenEntries)
                {
                    builder.WriteEndLine();
                }
                first = false;

                if (!string.IsNullOrEmpty(entry.Comment))
                {
                    builder.AddSummary(entry.Comment);
                }
                builder.WriteLine($"{entry.Name} = {entry.Value},");
            }

            builder.EndScope();
        }