Net.Bluewalk.DotNetUtils/Extensions/EnumExtensions.cs
/// <summary>
/// Determines if enum flags overlap another enum flags
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
Determines if enum flags overlap another enum flags
Determines if enum flags overlap another enum flags
public static bool HasOverlappingFlags<T>(this T a, T b) where T : Enum
        {
            var values = Enum.GetValues(typeof(T)).Cast<T>().ToList();
            return values.Any(v => a.HasFlag(v) && b.HasFlag(v));
        }
public static bool HasOverlappingFlags < T > ( this T a , T b ) where T : Enum { var values = Enum . GetValues ( typeof ( T ) ) . Cast < T > ( ) . ToList ( ) ; return values . Any ( v => a . HasFlag ( v ) && b . HasFlag ( v ) ) ; }
Determines if enum flags overlap another enum flags
Determines if enum flags overlap another enum flags
None
T
this
b
T
None
a
None
typeparam
None