public static sconnAlarmSystem GetFakeAlarmSconnAlarmSystem()
        {
            sconnAlarmSystem sys = new sconnAlarmSystem();
            var fakeables        = sys.GetType().GetProperties();

            foreach (PropertyInfo prop in fakeables)
            {
                try
                {
                    if (prop.PropertyType.GetInterfaces().Contains(typeof(IFakeAbleConfiguration)))  //typeof(IFakeAbleConfiguration).IsAssignableFrom(typeof(prop.)))  //fakeAblePropType
                    {
                        MethodInfo minfo = prop.PropertyType.GetMethod("Fake");
                        var        imp   = prop.GetValue(sys, null);
                        minfo?.Invoke(imp, null);
                    }
                }
                catch (Exception e)
                {
                }
            }
            return(sys);
        }
Beispiel #2
0
 public AlarmSystemConfigManager()
 {
     Config          = new sconnAlarmSystem();
     MinUpdatePeriod = 500;
 }