From 5eeafe3af80bfd88306bd8ad9e76c8f4b51ca35f Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 14:16:20 +0800
Subject: [PATCH] 增加本地发送的重发机制

---
 HDL_ON/UI/UI0-Public/TopViewDiv.cs |  132 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 119 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
index b274695..31e109f 100644
--- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs
+++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -1,4 +1,5 @@
 锘縰sing System;
+using System.Collections.Generic;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
 using Shared;
@@ -50,12 +51,12 @@
         /// TopViewDiv
         /// </summary>
         /// <param name="frame">鐖舵帶浠�</param>
-        /// <param name="str">鏍囬</param>
+        /// <param name="title">鏍囬</param>
         /// <param name="needClose">鏄惁闇�瑕佸叧闂〉闈�</param>
-        public TopViewDiv(FrameLayout frame, string str, bool needClose)
+        public TopViewDiv(FrameLayout frame, string title, bool needClose)
         {
             baseView = frame;
-            title = str;
+            this.title = title;
             this.needClose = needClose;
         }
 
@@ -87,7 +88,7 @@
             };
             baseView.AddChidren(contentView);
 
-            btnBack = new Button()
+            Button btnBackIcon = new Button()
             {
                 X = Application.GetRealWidth(10),
                 Y = Application.GetRealHeight(29),
@@ -95,7 +96,14 @@
                 Height = Application.GetRealWidth(28),
                 UnSelectedImagePath = "Public/BackIcon.png",
             };
-            baseView.AddChidren(btnBack);
+            contentView.AddChidren(btnBackIcon);
+
+            btnBack = new Button()
+            {
+                Width = Application.GetRealWidth(50),
+                //BackgroundColor = CSS_Color.AuxiliaryColor2,
+            };
+            contentView.AddChidren(btnBack);
 
             Button btnTilte = new Button()
             {
@@ -108,7 +116,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 Text = title
             };
-            baseView.AddChidren(btnTilte);
+            contentView.AddChidren(btnTilte);
 
 
             LoadEventList();
@@ -122,6 +130,28 @@
             backAction = backAct;
 
             LoadTopView();
+        }
+
+        public void LoadTopView_RoomTop(Action backAction ,Action editAction)
+        {
+            this.backAction = backAction;
+
+            LoadTopView();
+
+            var btnSetting = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/FuncInfoSetIcon.png",
+            };
+            contentView.AddChidren(btnSetting);
+
+            btnSetting.MouseUpEventHandler = (sender, e) =>
+            {
+                editAction();
+            };
         }
 
         /// <summary>
@@ -145,7 +175,7 @@
             };
             contentView.AddChidren(btnSetting);
 
-            btnSetting.MouseUpEventHandler += (sender, e) =>
+            btnSetting.MouseUpEventHandler = (sender, e) =>
             {
                 var infoView = new FunctionBaseInfoSetPage(function, action);
                 MainPage.BasePageView.AddChidren(infoView);
@@ -205,16 +235,92 @@
         }
 
         /// <summary>
-        /// 鍚慺ramelayout娣诲姞椤堕儴鍖哄煙,鎷ユ湁娣诲姞鍥炬爣鐨勬寜閽�,杩斿洖鏈夊洖璋冧簨浠�
+        /// 妤煎眰绠$悊椤堕儴鏍�
         /// </summary>
-        /// <param name="type"></param>
-        /// <param name="callBack"></param>
-        /// <param name="action"></param>
-        public void LoadTopView_AddIcon_BackAction(string type, Action<string, string> callBack,Action action)
+        public void LoadTopView_FloorTopView(Action<string> callBack,Action action)
         {
-            LoadTopView_AddIcon(type, callBack);
+            LoadTopView();
 
             backAction = action;
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/AddIcon.png",
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                Action<string> callBackAction = (floorName) =>
+                {
+                    callBack(floorName);
+                };
+                string newFloorName = "1F";
+                for (int i = 0; i < SpatialInfo.CurrentSpatial.FloorList.Count + 1;)
+                {
+                    newFloorName = ++i + "F";
+                    if (null == SpatialInfo.CurrentSpatial.FloorList.Find((obj) => obj.roomName == newFloorName))
+                    {
+                        break;
+                    }
+                }
+                var fs = new List<string>();
+                foreach (var f in SpatialInfo.CurrentSpatial.FloorList)
+                {
+                    fs.Add(f.roomName);
+                }
+                new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, newFloorName, callBackAction, StringId.FloorNameCannotBeEmpty,
+                    StringId.AddFloorFailed_FloorAlreadyExist, fs);
+            };
+        }
+        /// <summary>
+        /// 鎴块棿绠$悊椤堕儴鏍�
+        /// </summary>
+        public void LoadTopView_RoomTopView(Action callBack)
+        {
+            LoadTopView();
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/AddIcon.png",
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                callBack?.Invoke();
+            };
+        }
+        /// <summary>
+        /// 鎴愬憳椤堕儴鏍�
+        /// </summary>
+        public void LoadTopView_MemberTopView(Action callBack, Action action)
+        {
+            LoadTopView();
+            backAction = action;
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(337),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/AddIcon.png",
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                callBack?.Invoke();
+            };
         }
     }
 }

--
Gitblit v1.8.0