AttributeTargetTypes strongly typed?

Robert Sirre's Avatar

Robert Sirre

23 May, 2013 11:58 AM

I think I known the answer already, but still, wouldn't it be nice that instead of providing the names (or name pattern) of classes to apply an attribute to, one could set the actual type:

AttributeTargetTypes=typeof(TargetClass)

instead of
AttributeTargetTypes="TargetClass"

I guess the answer is that the type is not a compile-time constant and therefore cannot be set, and that there's no workaround for this.

  1. 1 Posted by Robert Sirre on 06 Jun, 2013 09:01 AM

    Robert Sirre's Avatar

    Gael,

    I think I saw a comment of you passing on StackOverflow, where you yourself already indicated to prefer not to use AttributeTargetTypes, exactly because of this reason.

    Guess this drawback has already been bumped into and cannot be solved easily, this feature request can then be closed as unfeasible.

  2. Support Staff 2 Posted by PostSharp Techn... on 07 Jun, 2013 03:21 PM

    PostSharp Technologies's Avatar

    Hi Robert,

    It would not be a problem to implement this feature (although it would need to be a new property with a new name for backward compatibility).

    The best way to send feature requests for now is to post them to https://postsharp.uservoice.com/

    -gael

  3. 3 Posted by Robert Sirre on 10 Jun, 2013 08:47 PM

    Robert Sirre's Avatar

    Okay, I posted it there:
    http://postsharp.uservoice.com/forums/4949-general/suggestions/4047...

    Quite a short wishlist, my request might actually make it :)

  4. Support Staff 4 Posted by PostSharp Techn... on 11 Jun, 2013 08:39 AM

    PostSharp Technologies's Avatar

    Thanks. Yep the list is short - we've just started using this website.

  5. PostSharp Technologies closed this discussion on 11 Jun, 2013 08:39 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac