Assembly: PostSharp (in PostSharp.dll) Version: 22.214.171.124 (126.96.36.199)
[FlagsAttribute] public enum MulticastAttributes
|0||Specifies that the set of target attributes is inherited from the parent custom attribute.|
|2||Private (visible inside the current type).|
|4||Protected (visible inside derived types).|
|8||Internal (visible inside the current assembly).|
|16||Internal and protected (visible inside derived types that are defined in the current assembly).|
|32||Internal or protected (visible inside all derived types and in the current assembly).|
|64||Public (visible everywhere).|
|384||Any scope (| ).|
|1024||Concrete (non-abstract) methods.|
|1536||Any abstraction (| ).|
|6144||Any virtuality (| ).|
|8192||Managed code implementation.|
|16384||Non-managed code implementation (external or system).|
|24576||Any implementation (| ).|
|98304||Any field literality (| ).|
|524288||User-generated code (anything expected).|
|786432||Any code generation (| )l|
|1048576||Output (out in C#) parameters.|
|2097152||Input/Output (ref in C#) parameters.|
|3276800||Any kind of parameter passing (| | ).|
If you specify this in a MulticastAttributeUsageAttribute, then the annotated attribute can only be multicast to elements that have these attributes. For example, if you create an aspect and annotate it with [MulticastAttributeUsage(TargetMemberAttributes=MulticastAttributes.Protected)], then multicasting will never apply the aspect to any type member that isn't protected.
If you specify this in a property of MulticastAttribute, then that specific multicast will be even more narrowed just to elements that have these attributes. For example, if you annotate a class with the aspect from the previous paragraph with [MyAspect(TargetMemberAttributes=MulticastAttributes.Virtual)], then it will only apply to that class's members that are both protected and, for methods, virtual.
There are 8 categories of flags. If you specify at least one flag for a category, you narrow the multicast just to elements that have one of the flags you specified in the category. For example, if you specify Public | Protected, you multicast to elements that are public or protected, but not private. Their other attributes (such as whether they are instance or static) do not matter.
The categories are visibility (public, private, ...); scope (static or instance); abstraction (abstract or non-abstract); virtuality (virtual or non-virtual); implementation (managed or unmanaged); literality (literal or nonliteral); generation (compiler-generated or user-created); and parameter (in, ref, or out).
If a category doesn't make sense for an element, then specifying its flags will have no effect for that element. For example, if you narrow your multicast down to virtual elements, it will still apply to fields or types (which can't be virtual).