I have enum flags. How to get all combinations of flags that do not contain a specific one?
[Flags]
public enum TestEnum
{
A = 1,
B = 2,
C = 4,
D = 8
}
public static IEnumerable<Enum> AllNotContaining(this Enum value)
{....}
For example, TestEnum.A.AllNotContaining()
should return {2, 4, 6, 8, 10, 12, 14}
.