コード例 #1
0
 public static ILyricParser GetLyricParserInstance(LyricParserTypeEnum value)
 {
     FieldInfo fi = typeof(LyricParserTypeEnum).GetField(value.ToString());
     LyricParserAttribute[] attributes =
       (LyricParserAttribute[])fi.GetCustomAttributes(
       typeof(LyricParserAttribute), false);
     return (attributes.Length > 0) ? attributes[0].LyricParser : null;
 }
コード例 #2
0
 public static string GetLyricParserExtension(LyricParserTypeEnum value)
 {
     FieldInfo fi = typeof(LyricParserTypeEnum).GetField(value.ToString());
     LyricParserAttribute[] attributes =
       (LyricParserAttribute[])fi.GetCustomAttributes(
       typeof(LyricParserAttribute), false);
     return (attributes.Length > 0) ? attributes[0].Extension : string.Empty;
 }