示例#1
0
 public GapEnumGenerator(EnumValueMode valueMode)
 {
     ValueMode = valueMode;
 }
示例#2
0
 public RegularEnumGenerator(bool constEnums, EnumValueMode valueMode) : base(valueMode)
 {
     ConstEnums = constEnums;
 }
示例#3
0
 public TypeEnumGenerator(EnumValueMode valueMode) : base(valueMode)
 {
 }
示例#4
0
 /// <summary>
 /// Obtains the string value for the given enum field (<paramref name="enumValue"/>).
 /// The value obtained depends on the <paramref name="mode"/> specified.
 /// </summary>
 /// <param name="mode">The mode used to generate the enum value, it can be the enum field value or the enum field name.</param>
 /// <param name="enumValue">The field/option of the enum that the values needs to be obtained from.</param>
 protected static string GetEnumValue(EnumValueMode mode, TsEnumValue enumValue)
 {
     return(mode == EnumValueMode.Number ? enumValue.Value : "\"" + enumValue.Name + "\"");
 }