diff --git a/Libraries/UniversalEditor.Core/ExtensionMethods.cs b/Libraries/UniversalEditor.Core/ExtensionMethods.cs index 98e9bd9d..cc21bb48 100644 --- a/Libraries/UniversalEditor.Core/ExtensionMethods.cs +++ b/Libraries/UniversalEditor.Core/ExtensionMethods.cs @@ -118,6 +118,29 @@ namespace UniversalEditor return true; } + /// + /// Returns if is equal + /// to any one of the values in . + /// + /// true, if a match was found; false otherwise. + /// The value to test. + /// + /// An array of items of type to check equality + /// against . + /// + public static bool EqualsAny(this IEquatable value, params T[] anyOf) + { + for (int i = 0; i < anyOf.Length; i++) + { + T any = anyOf[i]; + if (value.Equals(any)) + { + return true; + } + } + return false; + } + public static bool ContainsAny(this string value, params string[] anyOf) { bool result;