Exemple #1
0
        public virtual void Print(EnumValueNode node, StringBuilder sb, PrintOption opt, params object[] values)
        {
            var maxNameLength = (int)values[0];

            sb.Append(opt.MakeIndentSpace());

            sb.Append(node.Name.PadRight(maxNameLength));

            if ((!node.NumberIsAutoGen || opt.ShowAllEnumNumber))
            {
                sb.AppendFormat(" = {0}", node.Number);
            }

            var commentSpace = " ".PadLeft(Math.Max(3 - node.Number.ToString().Length, 1));

            sb.Append(commentSpace);

            if (!string.IsNullOrEmpty(node.TrailingComment))
            {
                sb.AppendFormat("//{0}", node.TrailingComment);
            }

            sb.Append("\n");
        }
Exemple #2
0
 public void AddValue(EnumValueNode n)
 {
     Child.Add(n);
     Value.Add(n);
 }