/// <summary> /// Indicates if <paramref name="member"/>'s value has all of the flags that are defined in its enum type. /// </summary> /// <param name="member">The enum member.</param> /// <returns>Indication if <paramref name="member"/> has all of the flags that are defined in its enum type.</returns> /// <exception cref="ArgumentNullException"><paramref name="member"/> is <c>null</c>.</exception> public static bool HasAllFlags(this EnumMember member) { Preconditions.NotNull(member, nameof(member)); return(member.HasAllFlags()); }
/// <summary> /// Indicates whether <paramref name="member"/>'s value is a valid flag combination of its enum's defined values. /// </summary> /// <param name="member">The enum member.</param> /// <returns>Indication of whether <paramref name="member"/>'s value is a valid flag combination of its enum's defined values.</returns> /// <exception cref="ArgumentNullException"><paramref name="member"/> is <c>null</c>.</exception> public static bool IsValidFlagCombination(this EnumMember member) { Preconditions.NotNull(member, nameof(member)); return(member.IsValidFlagCombination()); }
/// <summary> /// Retrieves the <see cref="EnumMember{TEnum}"/>s of the flags that compose <paramref name="member"/>'s value. /// </summary> /// <typeparam name="TEnum">The enum type.</typeparam> /// <param name="member">The enum member.</param> /// <returns>The <see cref="EnumMember{TEnum}"/>s of the flags that compose <paramref name="member"/>'s value.</returns> /// <exception cref="ArgumentNullException"><paramref name="member"/> is <c>null</c>.</exception> public static IEnumerable <EnumMember <TEnum> > GetFlagMembers <TEnum>(this EnumMember <TEnum> member) { Preconditions.NotNull(member, nameof(member)); return(member.GetGenericFlagMembers()); }
/// <summary> /// Retrieves the flag count of <paramref name="member"/>. /// </summary> /// <param name="member">The flags enum value.</param> /// <returns>The flag count of <paramref name="member"/>.</returns> public static int GetFlagCount(this EnumMember member) { Preconditions.NotNull(member, nameof(member)); return(member.GetFlagCount()); }