gxc
2019-10-28 1c4904d77f484c075080942d87785481b52b6fb2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using System;
using System.Collections.Generic;
using Shared;
using Shared.Common;
using Shared.Phone;
using Shared.R;
using ZigBee.Device;
 
 
 
namespace Shared.Phone.Device.Logic
{
    public class DelayTime : FrameLayout
    {
        public DelayTime()
        {
            Tag = "Logic";
        }
        Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>();
      
        public void Show()
        {
            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
            var topFrameLayout = new FrameLayout
            {
                Height = Application.GetRealHeight(140),
                Y = Application.GetRealHeight(80),
            };
            AddChidren(topFrameLayout);
 
            var titleName = new Button
            {
                Text = "添加延时",
                TextSize = 17,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
            };
            topFrameLayout.AddChidren(titleName);
 
         
            var back = new Button
            {
                Width = Application.GetRealWidth(110),
                Height = Application.GetRealHeight(110),
                X = Application.GetRealWidth(20),
                Gravity = Gravity.CenterVertical,
                UnSelectedImagePath = "ZigeeLogic/Back.png",
            };
            topFrameLayout.AddChidren(back);
            back.MouseDownEventHandler += (sender, e) =>
            {
                RemoveFromParent();
            };
 
            var middle = new FrameLayout();
            middle.Y = topFrameLayout.Bottom;
            middle.Height = Application.GetRealHeight(1920 - 220 - 174);
            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
            this.AddChidren(middle);
 
 
 
 
            var timeview = new TimeView
            {
                Y = Application.GetRealHeight(400),
                Height = Application.GetRealHeight(600),
                BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor,
                Width = Application.GetRealWidth(1080),
            };
           middle.AddChidren(timeview);
 
            var btnComplete = new Button
            {
                Y = middle.Bottom,
                Height = Application.GetRealHeight(174),
                TextID = MyInternationalizationString.complete,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                TextSize = 16,
            };
            AddChidren(btnComplete);
 
 
            ///完成点击事件
            btnComplete.MouseUpEventHandler += (sender, e) =>
            {
                Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
                actionsInfo.Add("LinkType", 10);
                actionsInfo.Add("DelayTime", 5);
                Common.Logic.CurrentLogic.Actions.Add(actionsInfo);
                var logicCommunalPage = new LogicCommunalPage { };
                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                UserView.HomePage.Instance.PageIndex += 1;
                logicCommunalPage.Show(() => { });
            };
        }
    }
}