WJC
2020-03-23 8adaa664b3f4a1f5e05434dc245cc5d168ad718c
ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs
@@ -33,79 +33,51 @@
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            this.AddChidren(middle);
            LogicView.SaveView saveView = new LogicView.SaveView();
            saveView.frameLayout.Y = middle.Bottom;
            this.AddChidren(saveView.Show());
            int selectetimedvalue = 0;
            var timestrlist = new List<string> { "2", "5", "10", "20", "30", Language.StringByID(MyInternationalizationString.logiccustom) };
            foreach (var intvalue in timestrlist)
            foreach (var intValue in timestrlist)
            {
                FunView monView = new FunView();
                monView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png";
                monView.funnameBtn.Text = intValue + Language.StringByID(MyInternationalizationString.Minute);
                monView.funnameBtn.Tag = intValue;
                monView.funnextBtn.Width = Application.GetMinRealAverage(60);
                monView.funnextBtn.Height = Application.GetMinRealAverage(60);
                monView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png";
                monView.funnextBtn.Visible = false;
                middle.AddChidren(monView.FunFrameView());
                var timeframelayout = new FrameLayout
                {
                    Height = Application.GetRealHeight(160),
                    BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                };
                middle.AddChidren(timeframelayout);
                var timeniconBtn = new Button
                {
                    Width = Application.GetRealWidth(81),
                    Height = Application.GetRealHeight(81),
                    X = Application.GetRealWidth(58),
                    Y = Application.GetRealHeight(55),
                    UnSelectedImagePath = "ZigeeLogic/point.png",
                };
                timeframelayout.AddChidren(timeniconBtn);
                var timeRow = new RowLayout
                {
                    Y = Application.GetRealHeight(30),
                    Width = Application.GetRealWidth(850),
                    Height = Application.GetRealHeight(130),
                    X = Application.GetRealWidth(176),
                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
                };
                timeframelayout.AddChidren(timeRow);
                var timeBtn = new Button
                {
                    Text = intvalue.ToString() + Language.StringByID(MyInternationalizationString.Minute),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                    Tag = intvalue,
                    TextSize = 14,
                };
                timeRow.AddChidren(timeBtn);
                var selected = new SelectedButton(789);
                timeRow.AddChidren(selected);
                //判断一个字符是字符串还是数字
                if (intvalue.Length < 3)
                if (intValue.Length < 3)
                {
                    if (timevalue== int.Parse(intvalue) * 60)
                    if (timevalue == int.Parse(intValue) * 60)
                    {
                        selectedIcon.Visible = false;
                        selectedIcon = selected;
                        selected.Visible = true;
                        selectedIcon = monView.funnextBtn;
                        monView.funnextBtn.Visible = true;
                    }
                }
                else
                {
                    timeRow.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
                    monView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//最后一行增加20高度;
                    monView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///改变最后功能快线条颜色
                }
                EventHandler<MouseEventArgs> timeclick = (sender, e) =>
                monView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
                {
                    selectedIcon.Visible = false;
                    selectedIcon = selected;
                    selected.Visible = true;
                    if (Language.StringByID(MyInternationalizationString.logiccustom) == timeBtn.Tag.ToString())
                    selectedIcon = monView.funnextBtn;
                    monView.funnextBtn.Visible = true;
                    if (Language.StringByID(MyInternationalizationString.logiccustom) == monView.funnameBtn.Tag.ToString())
                    {
                        var secondList = new List<string>();
                        var minuteList = new List<string>();
                        for (int i = 0; i < 61; i++)
                        for (int i = 0; i < 60; i++)
                        {
                            if (i < 10)
                            {
@@ -132,51 +104,27 @@
                            selectIndex1 = timevalue / 60;
                            selectIndex2 = timevalue % 60;
                        }
                        PickerView.ShowNormal(minuteList, secondList, new List<string>(), (Index1, Index2, Index3) =>
                        PickerView.ShowNormal(minuteList, secondList, null, (Index1, Index2, Index3) =>
                          {
                              selectetimedvalue = int.Parse(minuteList[Index1].Split(' ')[0]) * 60 + int.Parse(secondList[Index2].Split(' ')[0]);
                              timemethod(common, selectetimedvalue, timevalue, edit);
                              TimeMethod(common, selectetimedvalue, timevalue, edit);
                          }, selectIndex1, selectIndex2, 0, Language.StringByID(MyInternationalizationString.logiccustom));
                    }
                    else
                    {
                        selectetimedvalue = int.Parse(timeBtn.Tag.ToString()) * 60;
                        selectetimedvalue = int.Parse(monView.funnameBtn.Tag.ToString()) * 60;
                    }
                };
                timeframelayout.MouseUpEventHandler += timeclick;
                timeniconBtn.MouseUpEventHandler += timeclick;
                timeRow.MouseUpEventHandler += timeclick;
                timeBtn.MouseUpEventHandler += timeclick;
                selected.MouseUpEventHandler += timeclick;
            }
            var saveFrameLayout = new FrameLayout
            saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
            {
                Y = middle.Bottom,
                Height = Application.GetRealHeight(260),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
            };
            this.AddChidren(saveFrameLayout);
            var btnsave = new Button
            {
                X = Application.GetRealWidth(85),
                Height = Application.GetRealHeight(130),//194
                Width = Application.GetRealWidth(910),
                Radius = (uint)Application.GetRealHeight(60),
                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
                TextID = MyInternationalizationString.Save,
                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
                TextSize = 16,
            };
            saveFrameLayout.AddChidren(btnsave);
            btnsave.MouseUpEventHandler += (sender, e) =>
            {
                timemethod(common, selectetimedvalue, timevalue, edit);
                TimeMethod(common, selectetimedvalue, timevalue, edit);
            };
        }
        public void timemethod(CommonDevice common, int selectetimedvalue, int timevalue, bool edit)
        public void TimeMethod(CommonDevice common, int selectetimedvalue, int timevalue, bool edit)
        {
            var deviceConditionsInfo = new Dictionary<string, string>();