| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | List<string> listBackupGwId = new List<string>();
|
| | | var fileData = Global.ReadFileByDirectory(DirNameResourse.LocalMemoryDirectory, DirNameResourse.BackupGatewayIdFile);
|
| | | if (fileData != null)
|
| | | {
|
| | | //新增:虽然概率低,但是确实发生了。如果有网络时,App重新绑定记录的网关失败的话
|
| | | //不应该删除它
|
| | | listBackupGwId = JsonConvert.DeserializeObject<List<string>>(System.Text.Encoding.UTF8.GetString(fileData));
|
| | | }
|
| | |
|
| | | List<string> listDelete = new List<string>(); |
| | | foreach (var gatewayId in this.dicGateway.Keys)
|
| | | {
|
| | | if (result.ContainsKey(gatewayId) == false)
|
| | | if (result.ContainsKey(gatewayId) == false && listBackupGwId.Contains(gatewayId) == false)
|
| | | {
|
| | | //本地存在云端不存在的网关,则删除
|
| | | listDelete.Add(gatewayId);
|