Hi,

I was looking at the "Attribute Based Validation" examples on the
newtelligence website
(http://www.newtelligence.com/news/AttributeBasedValidation.aspx), which
made me wonder about how attributes work...

I know that you can declare attributes on a class/member etc, and query
the attributes in your code using reflection (which is what the above
sample does), but how do you get the attribute to _automatically_ cause
code to be run on a field / method / class access?

The PrincipalPermission attribute is an example of the behaviour I am
thinking of - when there is a PrincipalPermission attribute on a method,
the framework(?) automatically calls Demand() to check the users
authentication. Is it possible to have other attributes automatically
called?

Thanks,

Kirk

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to