Lets say I have a sealed class Bank, and it has to properties string Name and int Code.
I have a custom attribute, AlertAttribute and I want to add it to each property in Bank class. How can I do that without modify the code of the Bank class? (no inheritance or partial class is allowed)
Is there any language mechanism to do it (compile-time)? Is it possible to add it by reflection (run-time)?
Thanks a lot.
eLopez
EDIT: I just want to know if it's possible at design time (compile-time) to add attributes with the constrains I exposed. If there none, I would consider to add at run-time, so given link to the answer would be implemented. Thanks