private static DeviceEvent DeserializeEvent(EventConfiguration eventConfiguration, JObject jsonObj) { DeviceEvent deviceEventRet = (DeviceEvent)jsonObj.ToObject(eventConfiguration.EventObectType); if (deviceEventRet == null) { deviceEventRet = new DeviceEventDefault(eventConfiguration.EventType, jsonObj); } return(deviceEventRet); }
//PRIVATE METHODS private static DeviceEvent DeserializeEvent(Type eventType, JObject jsonObj) { DeviceEvent deviceEventRet = (DeviceEvent)jsonObj.ToObject(eventType); if (deviceEventRet == null) { deviceEventRet = new DeviceEventDefault(jsonObj); } return(deviceEventRet); }