SharpCrafters Forum – LocationInterceptionAspect just on set property.

SharpCrafters Support Forum

        


LocationInterceptionAspect just on set... Expand / Collapse
Author
Message
Posted 12/15/2009 11:04:30 AM


Mario Toffia

Customer
I hope (or rather not <!-- s:) --> <!-- s:) --> this feature do not exist in postsharp 2.0.

I use a TypeLevelAspect in order to provide aspects on some properties and methods. The selection critera of which properties that shall have aspects (and what aspects) is determined in the ProvideAspects method.

The thing is that some properties shall have aspect X on read operation and aspect Y on set operation and some properties do only have aspects on set operation etc.

And I don't have a clue how to tell the weaver to actually just provide a specific aspect to a set operation on a property using LocationInterceptionAspects.

Is it doable, can the weaver determine by the overrides in the aspect to determine if it shall instrument the property get/set method or not?

I'd guess the other way around is just to method aspect on GetGetMethod/SetMethod, but I really like the LocationInterceptionAspect. But on the other hand I'm a newbie <!-- s:) --> <!-- s:) -->

Cheers,
Mario
Post #651
Posted 12/17/2009 7:01:56 AM


Gael Fraiteur

SharpCrafters
You can use LocationInterceptionAspect and implement OnSetValue only. The code generated for the getter will be fairly fast.
Post #652
« Prev Topic | Next Topic »


All times are GMT +1:00, Time now is 11:44am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.102. 7 queries. Compression Disabled.