views:

27

answers:

1

Need to verify that the attribute can be applied only to a class that implements a certain interface. Googled on that and couldn't find any way to access the type of the target class from the attribute code.

Is there any easy way to do that, please?

[optional] Is there a "portable" way (I mean, it would be totally great if the code will be compiled both in C# and Silverlight)?

update: I could pass the target class type as one of the attribute arguments, but I don't want to trust on that.

A: 

Apparently only PostSharp aspects can help, but the trade off will be bigger the the benefit.

BreakPhreak