From 06802250b4b9041d39d568c1dbe77684075006b2 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 11 三月 2020 10:03:44 +0800
Subject: [PATCH] 上传一个版本

---
 ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs |  358 ++++++-----------------------------------------------------
 1 files changed, 40 insertions(+), 318 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
index 56ff12d..93a3a2a 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
@@ -19,364 +19,86 @@
         {
 
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
 
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addaction,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.addaction;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
-            
+
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
 
-            #region ----- 璁惧------    
-            var deviceframelayout = new FrameLayout
+            #region ----- 璁惧------
+
+            FunView deviceview= new FunView();
+            deviceview.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
+            deviceview.funnameBtn.TextID = MyInternationalizationString.device;
+            middle.AddChidren(deviceview.FunFrameView());
+            deviceview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(deviceframelayout);
-
-            var deviceiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/function.png",
-
-            };
-            deviceframelayout.AddChidren(deviceiconBtn);
-
-            var devicerow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            deviceframelayout.AddChidren(devicerow);
-
-
-            var btndevice = new Button
-            {
-                TextID = MyInternationalizationString.device,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-               TextSize=15,
-            };
-            devicerow.AddChidren(btndevice);
-
-            var btndeviceback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-
-            };
-            devicerow.AddChidren(btndeviceback);
-
-            EventHandler<MouseEventArgs> devicestateclick = (sender, e) =>
-            {
-                var logicDevicePage = new LogicDevicePage();
-                UserView.HomePage.Instance.AddChidren(logicDevicePage);
+                var roomAndDeviceView = new RoomAndDeviceView();
+                UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                 UserView.HomePage.Instance.PageIndex += 1;
-                logicDevicePage.Show();
-
+                roomAndDeviceView.IfType = LogicView.IfString.Action_Logic;
+                roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addaction));
             };
-            deviceframelayout.MouseUpEventHandler += devicestateclick;
-            btndevice.MouseUpEventHandler += devicestateclick;
-            btndeviceback.MouseUpEventHandler += devicestateclick;
-            deviceiconBtn.MouseUpEventHandler += devicestateclick;
-            devicerow.MouseUpEventHandler += devicestateclick;
+
             #endregion
 
             #region ----- 鍦烘櫙------
-
-
-            var sceneframelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y= deviceframelayout.Bottom,
-            };
-            middle.AddChidren(sceneframelayout);
-
-            var sceneiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/scene.png",
-
-            };
-            sceneframelayout.AddChidren(sceneiconBtn);
-
-
-            var sceneRowLayout = new RowLayout {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            sceneframelayout.AddChidren (sceneRowLayout);
-
-            var scene = new Button {
-                TextID = MyInternationalizationString.scene,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            sceneRowLayout.AddChidren (scene);
-
-            var btnsceneback = new Button {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-            };
-            sceneRowLayout.AddChidren (btnsceneback);
-
-            EventHandler<MouseEventArgs> sceneclick = (sender, e) =>
+            FunView sceneview= new FunView();
+            sceneview.iconBtn.UnSelectedImagePath = "ZigeeLogic/scene.png";
+            sceneview.funnameBtn.TextID = MyInternationalizationString.scene;
+            sceneview.funFrameLayout.Y = deviceview.funFrameLayout.Bottom;
+            middle.AddChidren(sceneview.FunFrameView());
+            sceneview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var addScenePage = new AddScenePage();
                 UserView.HomePage.Instance.AddChidren(addScenePage);
                 UserView.HomePage.Instance.PageIndex += 1;
-                addScenePage.Show();
+                addScenePage.Show(LogicView.IfString.Action_LogicScene);
             };
-             sceneRowLayout.MouseUpEventHandler += sceneclick;
-             scene.MouseUpEventHandler += sceneclick;
-             btnsceneback.MouseUpEventHandler += sceneclick;
-            sceneframelayout.MouseUpEventHandler += sceneclick;
-            sceneiconBtn.MouseUpEventHandler += sceneclick;
             #endregion
 
-            #region ----- 瀹夐槻妯″紡------        
-            var securityframelayout = new FrameLayout
+            #region ----- 瀹夐槻妯″紡------
+            FunView securityview= new FunView();
+            securityview.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
+            securityview.funnameBtn.TextID = MyInternationalizationString.securitymode;
+            securityview.funFrameLayout.Y = sceneview.funFrameLayout.Bottom;
+            middle.AddChidren(securityview.FunFrameView());
+            securityview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                Y = sceneframelayout.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(securityframelayout);
-
-            var securityiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                UnSelectedImagePath = "ZigeeLogic/security.png",
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-            };
-            securityframelayout.AddChidren(securityiconBtn);
-
-            var securityrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            securityframelayout.AddChidren(securityrow);
-
-
-            var btnsecurity = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = MyInternationalizationString.securitymode,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            securityrow.AddChidren(btnsecurity);
-
-            var btnsecurityback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-            };
-            securityrow.AddChidren(btnsecurityback);
-
-            EventHandler<MouseEventArgs> securityclick = (sender, e) => {
                 var securityMode = new SecurityMode();
                 UserView.HomePage.Instance.AddChidren(securityMode);
                 UserView.HomePage.Instance.PageIndex += 1;
                 securityMode.Show();
             };
 
-            securityframelayout.MouseUpEventHandler += securityclick;
-            btnsecurity.MouseUpEventHandler += securityclick;
-            btnsecurityback.MouseUpEventHandler += securityclick;
-            securityiconBtn.MouseUpEventHandler += securityclick;
-            securityrow.MouseUpEventHandler += securityclick;
-            #endregion
-
-            #region ----- 宸叉湁鑷姩鍖�------      
-
-            ///宸叉湁鑷姩鍖�
-            var existenceRowLayout = new RowLayout
-            {
-                Height = Application.GetRealHeight(180),
-                //BackgroundColor = 0xff323232,
-                Y = securityframelayout.Bottom,
-            };
-            //middle.AddChidren(existenceRowLayout);
-
-            var existence = new Button
-            {
-                Width = Application.GetRealWidth(400),
-                TextID = MyInternationalizationString.Alreadyautomated,
-                //Text = "宸叉湁鑷姩鍖�",
-                TextSize = 15,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            existenceRowLayout.AddChidren(existence);
-
-            var btnexistenceback = new Button
-            {
-                Width = Application.GetRealWidth(110),
-                Height = Application.GetRealHeight(110),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                SelectedImagePath = "ZigeeLogic/NextSelecte.png",
-                X = Application.GetRealWidth(1080 - 140),//550
-                Gravity = Gravity.CenterVertical,
-            };
-            existenceRowLayout.AddChidren(btnexistenceback);
-
-            EventHandler<MouseEventArgs> existenceclick = (sender, e) => {
-                var logicListPage = new LogicListPage();
-                UserView.HomePage.Instance.AddChidren(logicListPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicListPage.Show();
-            };
-
-            existenceRowLayout.MouseUpEventHandler += existenceclick;
-            existence.MouseUpEventHandler += existenceclick;
-            btnexistenceback.MouseUpEventHandler += existenceclick;
             #endregion
 
             #region ----- 寤舵椂------
 
-            var delayedframelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y = securityframelayout.Bottom,
-            };
-            middle.AddChidren(delayedframelayout);
-
-            var delayediconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/delay.png",
-
-            };
-            delayedframelayout.AddChidren(delayediconBtn);
-
-            var delayedRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            delayedframelayout.AddChidren(delayedRowLayout);
-
-            var delayed = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = MyInternationalizationString.delayed,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            delayedRowLayout.AddChidren(delayed);
-
-            var btndelayedback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-            };
-            delayedRowLayout.AddChidren(btndelayedback);
-
-            EventHandler<MouseEventArgs> delayedclick = (sender, e) =>
+            FunView delayedview = new FunView();
+            delayedview.iconBtn.UnSelectedImagePath = "ZigeeLogic/delay.png";
+            delayedview.funnameBtn.TextID = MyInternationalizationString.delayed;
+            delayedview.funFrameLayout.Y = securityview.funFrameLayout.Bottom;
+            delayedview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+            middle.AddChidren(delayedview.FunFrameView());
+            delayedview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var delayTime = new DelayTime();
                 UserView.HomePage.Instance.AddChidren(delayTime);
                 UserView.HomePage.Instance.PageIndex += 1;
                 delayTime.Show();
             };
-
-            delayedRowLayout.MouseUpEventHandler += delayedclick;
-            delayed.MouseUpEventHandler += delayedclick;
-            btndelayedback.MouseUpEventHandler += delayedclick;
-            delayedframelayout.MouseUpEventHandler += delayedclick;
-            delayediconBtn.MouseUpEventHandler += delayedclick;
+        
             #endregion
         }
 

--
Gitblit v1.8.0