public bool CanReconstituteThis(DeviceDataRecord raw) { string recordType = raw.GetString(AgentKeys.RecordType); string agent = raw.GetString(AgentKeys.AgentName); bool canHandle = false; if (agent == AgentId && recordType == MODELDEVICE_RECORDTYPE) { canHandle = true; } return(canHandle); }
public ModelDevice ReconstituteDevice(DeviceDataRecord raw) { if (raw == null) { return(null); } if (!CanReconstituteThis(raw)) { return(null); } var device = new ModelDeviceSample(); ExtractCommonDevicePropertiesFromNVPairs(raw, device); device.IPAddress = raw.GetString(Consts.IPADDRESS_KEY); device.DeviceName = raw.GetString(Consts.DEVICENAME_KEY); device.Dirty = false; return(device); }
public ModelDevice ReconstituteDevice(DeviceDataRecord raw) { if (raw == null) return null; if (!CanReconstituteThis(raw)) return null; var device = new ModelDeviceSample(); ExtractCommonDevicePropertiesFromNVPairs(raw, device); device.IPAddress = raw.GetString(Consts.IPADDRESS_KEY); device.DeviceName = raw.GetString(Consts.DEVICENAME_KEY); device.Dirty = false; return device; }
public bool CanReconstituteThis(DeviceDataRecord raw) { string recordType = raw.GetString(AgentKeys.RecordType); string agent = raw.GetString(AgentKeys.AgentName); bool canHandle = false; if (agent == AgentId && recordType == MODELDEVICE_RECORDTYPE) { canHandle = true; } return canHandle; }