© { JSL }
134
Text Box: Attributes
Attributes
Folded Corner:
·retrieving custom attributes
public sealed class DeveloperAttribute ...
{
    ...
    public override string ToString()
    {
        ...
    }
    ...
}
public class Example
{
    static void Main()
    {
        string typename = "ConstInt";
        Type t = Type.GetType(typename);
        object[] atts = t.GetCustomAttributes(true);
        foreach (object att in atts) {
            Console.WriteLine(att);
        }
    }
}