16 lines
284 B
C#
16 lines
284 B
C#
|
using System;
|
||
|
|
||
|
namespace Aitex.Core.Utilities
|
||
|
{
|
||
|
public class EnumLoop<Key> where Key : struct, IConvertible
|
||
|
{
|
||
|
private static readonly Key[] arr = (Key[])Enum.GetValues(typeof(Key));
|
||
|
|
||
|
public static void ForEach(Action<Key> act)
|
||
|
{
|
||
|
foreach (var t in arr)
|
||
|
act(t);
|
||
|
}
|
||
|
}
|
||
|
}
|