Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
 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;
 }