Exemplo n.º 1
0
 public static void Gen(System.IO.StreamWriter sw, Document doc, EnumDefine e, string prefix, Property.DataOutputFlags flags)
 {
     sw.WriteLine($"{prefix}public enum {e.Name}");
     sw.WriteLine($"{prefix}{{");
     foreach (var v in e.ValueMap.Values)
     {
         sw.WriteLine($"{prefix}    {v.Name} = {v.Value},");
     }
     sw.WriteLine($"{prefix}}}");
 }
Exemplo n.º 2
0
        public static void Gen(StreamWriter sw, Document doc, EnumDefine e, Property.DataOutputFlags flags)
        {
            var fullName = e.FullName().Replace('.', '_');

            sw.WriteLine($"export enum {fullName} {{");
            foreach (var v in e.ValueMap.Values)
            {
                sw.WriteLine($"    {v.Name} = {v.Value},");
            }
            sw.WriteLine($"}}");
        }