| | |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | { |
| | | if (scanString.StartsWith("source://bind/")) |
| | | if (string.IsNullOrEmpty(scanString)) |
| | | { |
| | | var waitPage = new Loading(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Start("Plaese wait..."); |
| | | }); |
| | | var sendString = scanString.Replace("source://bind/", ""); |
| | | MainPage.Log($"绑定source屏:{sendString}"); |
| | | //绑定source屏 |
| | | var pack = new HttpServerRequest().BindSourcePanel(sendString); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var title = Language.StringByID(StringId.Tip); |
| | | var msg = ""; |
| | | if(pack.Code == StateCode.SUCCESS) |
| | | { |
| | | if(Language.CurrentLanguage=="Chinese") |
| | | { |
| | | msg = "Source屏绑定成功."; |
| | | } |
| | | else |
| | | { |
| | | msg = "Source Hub binding succeeded"; |
| | | } |
| | | new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); |
| | | } |
| | | else |
| | | { |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | msg = $"Source屏绑定失败.({pack.Code})"; |
| | | } |
| | | else |
| | | { |
| | | msg = "Source Hub binding failed"; |
| | | } |
| | | new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); |
| | | } |
| | | }); |
| | | } |
| | | catch(Exception ex) |
| | | { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | //执行绑定住宅 |
| | | new BindingResidencePage().DoBindResidence(scanString); |
| | | if (scanString.StartsWith("source://bind/")) |
| | | { |
| | | var waitPage = new Loading(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Start("Plaese wait..."); |
| | | }); |
| | | var sendString = scanString.Replace("source://bind/", ""); |
| | | MainPage.Log($"绑定source屏:{sendString}"); |
| | | //绑定source屏 |
| | | var pack = new HttpServerRequest().BindSourcePanel(sendString); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var title = Language.StringByID(StringId.Tip); |
| | | var msg = ""; |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | msg = "Source屏绑定成功."; |
| | | } |
| | | else |
| | | { |
| | | msg = "Source Hub binding succeeded"; |
| | | } |
| | | new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); |
| | | } |
| | | else |
| | | { |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | msg = $"Source屏绑定失败.({pack.Code})"; |
| | | } |
| | | else |
| | | { |
| | | msg = "Source Hub binding failed"; |
| | | } |
| | | new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); |
| | | } |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | //执行绑定住宅 |
| | | new BindingResidencePage().DoBindResidence(scanString); |
| | | } |
| | | } |
| | | }); |
| | | }; |