我正在尝试设置 PostSharp 方面RunOutOfProcessAttribute
,以便它适用于:
- 所有公共方法
- 任何标有 的方法
DoSpecialFunctionAttribute
,无论成员可访问性如何(公共/受保护/私有/其他)。
到目前为止,我RunOutOfProcessAttribute
的定义是这样的:
[Serializable]
[MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Public)]
[AttributeUsage(AttributeTargets.Class)]
public class RunOutOfProcessAttribute : MethodInterceptionAspect
{
public override void OnInvoke(MethodInterceptionArgs args)
{
...
}
}
已经到位的应该满足上面的MulticastAttributeUsageAttribute
标准 1,但我不知道如何满足标准 2,而不是简单地将现有方面的行为复制到新属性中。
DoSpecialFunctionAttribute
无论成员可访问性如何(公共/受保护/私有/其他),我如何将此方面应用于任何标有 的方法?