From a61775710f8c4466db5bfce58af58f886d58edf3 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 14 十二月 2022 10:04:06 +0800 Subject: [PATCH] 备份 --- SmartHome/UI/SimpleControl/Phone/System/SearchServerOnePortListPage.cs | 47 ++++++++++++++++++++++++++++++----------------- 1 files changed, 30 insertions(+), 17 deletions(-) diff --git a/SmartHome/UI/SimpleControl/Phone/System/SearchServerOnePortListPage.cs b/SmartHome/UI/SimpleControl/Phone/System/SearchServerOnePortListPage.cs index c8e42fc..9b7c4ab 100644 --- a/SmartHome/UI/SimpleControl/Phone/System/SearchServerOnePortListPage.cs +++ b/SmartHome/UI/SimpleControl/Phone/System/SearchServerOnePortListPage.cs @@ -8,14 +8,14 @@ public class SearchServerOnePortListPage : FrameLayout { #region 鏂囨湰 - string text_Title = "杩滅▼杩炴帴"; + string text_Title = "杩滅▼"; string text_userName = "缁勫悕"; string text_projectName = "宸ョ▼鍚�"; string text_password = "瀵嗙爜"; string text_entry_userName_tip = "璇疯緭鍏ョ粍鍚嶃��"; string text_entry_projectName_tip = "璇疯緭鍏ュ伐绋嬪悕銆�"; string text_entry_password_tip = "璇疯緭鍏ュ瘑鐮併��"; - string text_link = "杩炴帴涓�绔彛"; + string text_link = "杩炴帴"; string text_back = "鍚庨��"; string text_reading = "璇诲彇涓�"; /// <summary> @@ -40,11 +40,12 @@ string text_readFailure = "璇诲彇澶辫触"; string txt_breakLink = "鏂紑杩炴帴"; - string txt_connectionSucceeded = "杩炴帴鎴愬姛"; + string txt_connectionSucceeded = "鎼滅储瀹屾垚"; string txt_linkSeverFailed = "杩炴帴鏈嶅姟鍣ㄥけ璐�"; string txt_DataError = "鏁版嵁寮傚父"; string txt_QueryFailed = "鏌ヨ澶辫触"; + string txt_NoData = "鏃犳暟鎹�"; string txt_Search = "鎼滅储"; #endregion @@ -66,7 +67,7 @@ public SearchServerOnePortListPage () { if (Language.CurrentLanguage != "Chinese") { - text_Title = "Remote connection"; + text_Title = "Remote"; text_userName = "Group name"; text_projectName = "project name"; text_password = "Password"; @@ -82,11 +83,12 @@ text_link = "Link"; text_reading = "Reading"; txt_breakLink = "Break link"; - txt_connectionSucceeded = "Connection succeeded"; + txt_connectionSucceeded = "Search complete"; txt_linkSeverFailed = "Failed to connect to the server"; txt_DataError = "Data exception"; txt_QueryFailed = "Query failed"; txt_Search = "search"; + txt_NoData = "No data"; } } @@ -179,7 +181,7 @@ userNameView.AddChidren (tvUserName); var btnLine = new Button () { - Height = Application.GetRealHeight (1), + Height = Application.GetRealHeight (2), BackgroundColor = SkinStyle.Current.LineColor, }; infoView.AddChidren (btnLine); @@ -263,8 +265,9 @@ if (oneProtData != null) { try { var groupName = System.Text.Encoding.UTF8.GetString (oneProtData, 1, 20).Trim ('\0');//============= - var projectName = System.Text.Encoding.UTF8.GetString (oneProtData, 23, 20).Trim ('\0');//============= - var userName = System.Text.Encoding.UTF8.GetString (oneProtData, 43, 8).Trim ('\0');//============= + var projectName22 = System.Text.Encoding.UTF8.GetString (oneProtData, 23, 20).Trim ('\0');//============= + var userName22 = System.Text.Encoding.UTF8.GetString (oneProtData, 43, 8).Trim ('\0');//============= + var isOnline = oneProtData [57] == 1; Application.RunOnMainThread (() => { RowLayout wirelessView = new RowLayout () { @@ -272,7 +275,7 @@ BackgroundColor = SkinStyle.Current.ViewColor, }; listView.AddChidren (wirelessView); - showGatewayRow (userName,projectName, wirelessView); + showGatewayRow (userName22,projectName22, wirelessView,isOnline); }); }catch (Exception ex) { @@ -281,7 +284,14 @@ } } - } else { + } + else if(sss[1] == 245) { + Application.RunOnMainThread (() => { + rightButton1.Text = txt_NoData; + rightButton1.TextColor = 0x99FF0000; + }); + } + else { Application.RunOnMainThread (() => { rightButton1.Text = txt_QueryFailed; rightButton1.TextColor = 0x99FF0000; @@ -328,18 +338,19 @@ /// <summary> /// 鏄剧ず /// </summary> - void showGatewayRow (string userName,string projectName, RowLayout wirelessView) + void showGatewayRow (string userName,string projectName, RowLayout wirelessView,bool isOnline) { Button pointButton1 = new Button () { - Width = Application.GetRealHeight (13), - Height = Application.GetRealHeight (13), + Width = Application.GetRealHeight (20), + Height = Application.GetRealHeight (20), X = Application.GetRealWidth (60), - UnSelectedImagePath = "Item/Point.png", - SelectedImagePath = "Item/PointSelected.png", + Radius = (uint)Application.GetRealHeight (7), Gravity = Gravity.CenterVertical, + BackgroundColor = isOnline ? 0xFF00FF00: 0xFF000000 }; wirelessView.AddChidren (pointButton1); + Button nameButton1 = new Button () { Width = Application.GetRealWidth (342), @@ -353,15 +364,17 @@ Button rightButton1 = new Button () { X = Application.GetRealWidth (480), - Width = Application.GetRealWidth (100), + Width = Application.GetRealWidth (150), Height = Application.GetRealHeight (40), Gravity = Gravity.CenterVertical, TextAlignment = TextAlignment.CenterLeft, TextColor = SkinStyle.Current.TextColor1, IsMoreLines = true, TextSize = 12, + Text = text_link, }; - wirelessView.AddChidren (rightButton1); + if (isOnline) + wirelessView.AddChidren (rightButton1); EventHandler<MouseEventArgs> eventHandler = (sender, e) => { LinkOnePort (userName,projectName); -- Gitblit v1.8.0