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(""); } }
public void UpdateDevice(DeviceCodeItem item) { this.activeDevice.productKeys[0] = item.deviceId; this.activeDevice.productKeys[1] = item.deviceName; this.activeDevice.productKeys[2] = item.secret; }