diff --git a/ICD.Common.Utils/EnumUtils.cs b/ICD.Common.Utils/EnumUtils.cs index af3f1e9..30a37e1 100644 --- a/ICD.Common.Utils/EnumUtils.cs +++ b/ICD.Common.Utils/EnumUtils.cs @@ -289,6 +289,20 @@ namespace ICD.Common.Utils return s_EnumFlagsCache[type][value].Cast(); } + /// + /// Gets all of the set flags on the given enum type except 0. + /// + /// + /// + public static IEnumerable GetFlagsExceptNone() + { + if (!IsEnumType()) + throw new ArgumentException(string.Format("{0} is not an enum", typeof(T).Name)); + + T allValue = GetFlagsAllValue(); + return GetFlagsExceptNone(allValue); + } + /// /// Gets all of the set flags on the given enum except 0. ///