From c2b68b777ddd4d9733e3bd64746929295c04ec45 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 10 八月 2020 11:53:45 +0800
Subject: [PATCH] 2020-08-10-1
---
ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs | 378 ++++++++---------------------------------------------
1 files changed, 60 insertions(+), 318 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
index 6d8fc64..637efc3 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
@@ -15,368 +15,110 @@
{
Tag = "Logic";
}
- public void Show ()
+ /// <summary>
+ /// 娣诲姞鐩爣鍔熻兘绫�
+ /// </summary>
+ /// <param name="str1">璁惧鐣岄潰璇嗗埆瀛楃涓�</param>
+ /// <param name="str2">鍦烘櫙鐣岄潰璇嗗埆瀛楃涓�</param>
+ public void Show (string str1,string str2)
{
#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 = 16,
- TextColor = ZigbeeColor.Current.LogicTextBlackColor,
- TextAlignment = TextAlignment.CenterLeft,
- X = Application.GetRealWidth(176),
- Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(69),
- Y = Application.GetRealHeight(92),
- TextID = MyInternationalizationString.addaction,
- };
- 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,
- Height = Application.GetRealHeight(1920 - 184),
+ Y = view.topRowLayout.Bottom,
+ Height = Application.GetRealHeight(Method.H - 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,
- };
- 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) =>
- {
- Common.Logic.LogicDviceList.Clear();
- if (Common.Logic.LogicDviceList.Count == 0)
- {
- Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
- }
- 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 = str1;
+ 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,
- };
- 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(str2);
};
- 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;
+ if (str1 == LogicView.IfString.Action_Logic)
+ { ///鑱斿姩浜嬩欢杈撳嚭-涓嶆敮鎸佸畨闃叉ā寮�
+ ///鑷姩鍖栬緭鍑�-鏀寔瀹夐槻妯″紡
+ middle.AddChidren(securityview.FunFrameView());
+ }
+ else
{
- Height = Application.GetRealHeight(160),
- Y = sceneframelayout.Bottom,
- BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- };
- middle.AddChidren(securityframelayout);
-
- var securityiconBtn = new Button
+ ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
+ sceneview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+ }
+ securityview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
{
- 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,
- };
- 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 = 16,
- 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
+ FunView delayedview = new FunView();
+ delayedview.iconBtn.UnSelectedImagePath = "ZigeeLogic/delay.png";
+ delayedview.funnameBtn.TextID = MyInternationalizationString.delayed;
+ delayedview.funFrameLayout.Y = securityview.funFrameLayout.Bottom;
+ delayedview.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+ delayedview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊
+ if (str1 == LogicView.IfString.Action_Logic)
{
- 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,
- };
- 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) =>
+ ///鑱斿姩浜嬩欢杈撳嚭-涓嶆敮鎸佸欢鏃�
+ ///鑷姩鍖栬緭鍑�-鏀寔寤舵椂
+ 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