///
/// This can have any description of the class
///
public class MyClass {}
In the above code sample, is th
If you don't want to use XML comments, you can store the description as metadata using the [Description]
attribute, i.e:
[Description("This can have any description of the class")]
public class MyClass {}
You can then access the value of this attribute at run-time:
public static string GetDescription(Type t) {
return TypeDescriptor.GetAttributes(t)
.OfType()
.Select(x => x.Description)
.FirstOrDefault();
}
e.g. GetDescription(typeof(MyClass))