I'm trying to set up a PostSharp aspect RunOutOfProcessAttribute
so that it applies to:
- all public methods
- any method marked with the
DoSpecialFunctionAttribute
, regardless of member accessibility (public/protected/private/whatever).
So far, my RunOutOfProcessAttribute
is defined thusly:
[Serializable]
[MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Public)]
[AttributeUsage(AttributeTargets.Class)]
public class RunOutOfProcessAttribute : MethodInterceptionAspect
{
public override void OnInvoke(MethodInterceptionArgs args)
{
...
}
}
The MulticastAttributeUsageAttribute
already in place should fulfil criterion 1 above, but I've got no idea how to fulfil criterion 2, without simply duplicating the behaviour of the existing aspect into a new attribute.
How would I get this aspect to apply to any method marked with the DoSpecialFunctionAttribute
, regardless of member accessibility (public/protected/private/whatever)?
DoSpecialFunctionAttribute
why not just include the function to do this in that attribute? rather than creating yet ANOTHER aspect. – CounterweighRunOutOfProcessAttribute
on a class, as it more defines a class behaviour than a method behaviour.RunOutOfProcessAttribute
should operate on all public class methods in addition to any protected one marked withDoSpecialFunctionAttribute
.DoSpecialFunctionAttribute
will not be an aspect. – Thoughtless