is there a way to combine flags within an Enum but to restrict the possible combinations? I have an enum like this:
[Flags]
public enum CopyFlags
{
/// <summary>
/// Copy members regardless of their actual case
/// </summary>
CaseSensitive = 1,
/// <summary>
/// Indicates if a leading underscore (e.g. _myMember) should be ignored while comparing member-names.
/// </summary>
IgnoreLeadingUnderscore = 2,
/// <summary>
/// Indicates if only properties should be copied. Usefull when all technical data is stored in properties.
/// </summary>
PropertiesOnly = 4
}
Now I want to also introduce a FieldsOnly
-value but ensure that it is only used when PropertiesOnly
is not present. Is this possible?