using System.Collections.Generic;
public string Part1 { get; set; }
public string Part2 { get; set; }
public string Part3 { get; set; }
public int Min { get; set; }
public static void Main(string[] args)
MemberInfo element = cast.GetType();
Attribute[] attrs = Attribute.GetCustomAttributes(element, typeof(Header), true);
Attribute[] attrs2 = Attribute.GetCustomAttributes(element, typeof(Option), true);
Console.WriteLine("before: //не работает");
Console.WriteLine(a.ToString());
Console.WriteLine("after: //не работает");
Console.WriteLine("before: //не работает");
foreach (var a in attrs2)
Console.WriteLine(a.ToString());
Console.WriteLine("after: //не работает");
Console.WriteLine("===================");
Header[] typeAttrs = (Header[])t.GetCustomAttributes(typeof(Header));
foreach (var tt in typeAttrs)
Console.WriteLine("Header: " + tt.Global.ToString());
Option[] typeAttrs2 = (Option[])t.GetCustomAttributes(typeof(Option));
foreach (var tt in typeAttrs2)
Console.Write("Title:" + tt.Title.ToString());
Console.WriteLine("\t Value: " + tt.Value.ToString());
public string Global{get;private set;}
public Header(string opHui)
public string Title {get;private set;}
public int Value{get;private set;}
public Option(string op, int hui)