コード例 #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);
        }
コード例 #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);
        }
コード例 #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;
        }
コード例 #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;
 }