mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
Fixing extension method gunk
This commit is contained in:
@@ -343,26 +343,27 @@ namespace ICD.Common.Utils
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if this enum contains any flags.
|
/// Returns true if the enum contains any flags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name=""></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[PublicAPI]
|
|
||||||
public static bool HasAnyFlags<T>(this T extends)
|
|
||||||
{
|
|
||||||
return GetFlagsExceptNone(extends).Any();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns true if this enum contains any of the given flag values.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="extends"></param>
|
|
||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public static bool HasAnyFlags<T>(this T extends, T value)
|
public static bool HasAnyFlags<T>(T value)
|
||||||
{
|
{
|
||||||
return GetFlagsIntersection(extends, value).HasAnyFlags();
|
return GetFlagsExceptNone(value).Any();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if the enum contains any of the given flag values.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <param name="other"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[PublicAPI]
|
||||||
|
public static bool HasAnyFlags<T>(T value, T other)
|
||||||
|
{
|
||||||
|
T intersection = GetFlagsIntersection(value, other);
|
||||||
|
return HasAnyFlags(intersection);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user