Yes, you can. We do such things.
[AttributeUsage(AttributeTargets.Assembly)] public class MyCustomAttribute : Attribute { string someText; public MyCustomAttribute() : this(string.Empty) {} public MyCustomAttribute(string txt) { someText = txt; } ... }
For reading use this linq type stmt.
var attributes = assembly .GetCustomAttributes(typeof(MyCustomAttribute), false) .Cast<MyCustomAttribute>();
Preet Sangha Dec 20 '09 at 20:44 2009-12-20 20:44
source share