mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
fix: Fixed EnumUtils.GetValuesExceptNone to work for non-flag enums
This commit is contained in:
committed by
Chris Cameron
parent
d00d2febf3
commit
c08a6283b8
@@ -22,7 +22,8 @@ namespace ICD.Common.Utils.Tests
|
|||||||
A = 1,
|
A = 1,
|
||||||
B = 2,
|
B = 2,
|
||||||
C = 4,
|
C = 4,
|
||||||
D = 32
|
D = 32,
|
||||||
|
BandC = B | C
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ namespace ICD.Common.Utils
|
|||||||
if (type == null)
|
if (type == null)
|
||||||
throw new ArgumentNullException("type");
|
throw new ArgumentNullException("type");
|
||||||
|
|
||||||
return GetFlagsExceptNone(type);
|
return GetValues(type).Where(v => (int)v != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user