From 925e55bc815de89575ec53880d3e059596fda6e6 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期六, 19 十二月 2020 13:23:46 +0800 Subject: [PATCH] Merge branch 'CJL' into NewFilePath --- HDL_ON/Common/HDLCommon.cs | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs old mode 100755 new mode 100644 index 02943ea..2ef00d9 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -6,6 +6,7 @@ using HDL_ON.UI; using HDL_ON.Entity; using System.Threading; +using HDL_ON.DriverLayer; namespace HDL_ON { @@ -381,6 +382,35 @@ { return string.IsNullOrEmpty(userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : userName; } + + + /// <summary> + /// 鐩戝惉缃戠粶鍙樺寲鍚庡鐞嗕簨浠� + /// 鍒锋柊缃戠粶鐘舵�� + /// </summary> + /// <param name="internetStatus">缃戠粶鍙樺寲</param> + /// <param name="IsEnterBackground">鏄惁杩涘叆浜嗗悗鍙�</param> + public void UpdateInternetStatus(int internetStatus, bool IsEnterBackground = false) + { + MainPage.Log($"缃戠粶鐘舵�佸彉鍖栵紝褰撳墠缃戠粶:{internetStatus} 鏄惁鍚庡彴:{IsEnterBackground.ToString()}"); + + if (internetStatus == 0)//娌℃湁缃戠粶杩炴帴 0 + { + Control.Ins.GatewayOnline = false; + Control.Ins.IsRemote = false; + MainPage.InternetStatus = 0; + } + else if (internetStatus == 1)//3,4G鐨勭綉缁滆繛鎺� 1 + { + Control.Ins.SearchLoaclGateway(); + MainPage.InternetStatus = 1; + } + else if (internetStatus == 2)//WiFi缃戠粶 + { + Control.Ins.SearchLoaclGateway(); + MainPage.InternetStatus = 2; + } + } #endregion } } -- Gitblit v1.8.0