Пример #1
0
 public string GetSerialNumberFromServer(DeviceItem device, ref Boolean result)
 {
     result = false;
     this.QuerySerialNumber(device);
     if (this.httpController.responseCode == ResponseResult.Ok)
     {
         try
         {
             DeviceCodeItem deviceCodeItem = JsonConvert.DeserializeObject <DeviceCodeItem>(this.httpController.responseText);
             result = deviceCodeItem.errorCode == 0;
             return(deviceCodeItem.deviceName);
         }
         catch (Newtonsoft.Json.JsonReaderException)
         {
             return("");
         }
     }
     else
     {
         return("");
     }
 }
Пример #2
0
 public void UpdateDevice(DeviceCodeItem item)
 {
     this.activeDevice.productKeys[0] = item.deviceId;
     this.activeDevice.productKeys[1] = item.deviceName;
     this.activeDevice.productKeys[2] = item.secret;
 }