what is the sense of having a flags enum like PropagationFlags if the content of the enum is:
- None: Specifies that no inheritance flags are set.
- NoPropagateInherit: Specifies that the ACE is not propagated to child objects.
- InheritOnly: Specifies that the ACE is propagated only to child objects. This includes both container and leaf child objects.
What will be the meaning of a variable with None | InheritOnly or NoPropagateInherit | InheritOnly?
I’m missing something or is this a .Net framework bad design?
The
Nonein that enum just means that you’re not setting any flags, essentially that you want the default behavior. The framework guidelines state that the zero (and therefor non-set or essentially null) should be called None. In this case the name might be confusing because you may think it means ‘No propagation’ but it doesn’t. The other two values are intended to beOR‘d together potentially.OR‘ing with zero always returns the original value.