fork download
  1. using System;
  2. using System.Xml.Serialization;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var x = TNFeInfNFeDetImpostoICMSICMS00CST.item00;
  7. Console.WriteLine(x.GetAttributeDescription());
  8. }
  9. }
  10.  
  11. public static class EnumExt {
  12. public static string GetAttributeDescription(this Enum enumValue) {
  13. var attributes = enumValue.GetType().GetMember(enumValue.ToString())[0].GetCustomAttributes(typeof(XmlEnumAttribute), false);
  14. return (attributes.Length > 0) ? ((XmlEnumAttribute)attributes[0]).Name : String.Empty;
  15. }
  16. }
  17.  
  18. public enum TNFeInfNFeDetImpostoICMSICMS00CST {
  19. [XmlEnumAttribute("00")]
  20. item00 = 00,
  21. }
  22.  
  23. //https://pt.stackoverflow.com/q/153789/101
Success #stdin #stdout 0.03s 17872KB
stdin
Standard input is empty
stdout
00