I have such a class
[Description(\"This is a wahala class\")]
public class Wahala
{
}
Is there anyway to get the content of the Descript
You can use reflection to read attribute data:
System.Reflection.MemberInfo inf = typeof(Wahala);
object[] attributes;
attributes =
inf.GetCustomAttributes(
typeof(DescriptionAttribute), false);
foreach(Object attribute in attributes)
{
DescriptionAttribute da = (DescriptionAttribute)attribute;
Console.WriteLine("Description: {0}", da.Description);
}
Adapted from here.