using Glorysoft.SECS.EQP.Common; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace ARI.EAP.HOST.Common { public static class EquipmentStatus { public static string S5F3 = "AlarmEnable"; public static ushort SpoolingFlag = 0; public static bool MQstate = false; public static Dictionary EventHandlers; public static ushort commandCount = 0; public static bool initStatus = false; static EquipmentStatus() { EventHandlers = new Dictionary(); foreach (Type item in MethodBase.GetCurrentMethod().DeclaringType.Assembly.GetTypes()) { if (item.IsClass && item.GetInterface(nameof(IEventHandler)) != null) { EventHandlers.Add(item.Name, Activator.CreateInstance(item) as IEventHandler); } } } } }