wjc
2023-08-03 72c7bdb62b203eeb6a590e96bf25a4e186bd45cd
HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs
@@ -48,7 +48,9 @@
        /// 删除设备后需要更新界面的回调
        /// </summary>
        public Action action;
        /// <summary>
        /// 记录当前设备
        /// </summary>
        public IntType currnetIntType= IntType.none;
        public VerticalScrolViewLayout vv;
@@ -179,13 +181,7 @@
            });
        }
        /// <summary>
        /// 切换界面
        ///1 = 播放器
        ///2 = 功放
        ///3 = 电视
        ///4 = 机顶盒
        ///5 = 投影仪
        ///6 = 万能遥控器
        /// 切换界面(1 = 播放器,2 = 功放,3 = 电视,4 = 机顶盒,5 = 投影仪,6 = 万能遥控器)
        /// </summary>
        private void SwitchUI(IntType type)
        {
@@ -215,37 +211,46 @@
                        };
                    }
                    break;
                case IntType.HiFi: { } break;
                case IntType.HiFi: {
                        GFPage gFPage = new GFPage();
                        this.vv.AddChidren(gFPage);
                        gFPage.Show();
                        gFPage.action += (type) =>
                        {
                            SelectedType();
                        };
                    } break;
                case IntType.TV: { } break;
                case IntType.STB: { } break;
                case IntType.Projector: { } break;
                case IntType.Projector: {
                        TYYPage tYYPage = new TYYPage();
                        this.vv.AddChidren(tYYPage);
                        tYYPage.Show();
                        tYYPage.action += (type) =>
                        {
                            SelectedType();
                        };
                    } break;
                case IntType.Control: { } break;
            }
        }
        /// <summary>
        /// 选中类型
        ///1 = 播放器
        ///2 = 功放
        ///3 = 电视
        ///4 = 机顶盒
        ///5 = 投影仪
        ///6 = 万能遥控器
        /// 选中类型弹框(1 = 播放器,2 = 功放,3 = 电视,4 = 机顶盒,5 = 投影仪,6 = 万能遥控器)
        /// </summary>
        /// <param name="button">显示文本</param>
        private void SelectedType()
        {
            var deviceTypeList = GetTypeDictionary().Values.ToList();
            ///之前的状态文本
            string currCondition = Language.StringByID(StringId.bofangqi);
            string ccurrnetDeviceStr= this.GetValueString(this.currnetIntType);
            PublicInterface conditionView = new PublicInterface();
            conditionView.SingleSelectionShow(this, deviceTypeList, "设备选择", currCondition
               , (stateValue) =>
            conditionView.SingleSelectionShow(this, deviceTypeList, "设备选择", ccurrnetDeviceStr
               , (valueStr) =>
               {
                   //界面显示选中值
                   //button.Text = stateValue;
                   var intType = this.GetKeyIntType(stateValue);
                   var intType = this.GetKeyIntType(valueStr);
                   this.SwitchUI(intType);
               });
@@ -284,7 +289,7 @@
        }
        /// <summary>
        ///
        /// 初始化字典
        /// </summary>
        /// <returns></returns>
        private Dictionary<IntType, string> GetTypeDictionary()
@@ -298,6 +303,11 @@
            dic.Add(IntType.Control, Language.StringByID(StringId.xuniyaokongqi));
            return dic;
        }
        /// <summary>
        /// 获取设备
        /// </summary>
        /// <param name="value">(1 = 播放器,2 = 功放,3 = 电视,4 = 机顶盒,5 = 投影仪,6 = 万能遥控器)</param>
        /// <returns></returns>
        private IntType GetKeyIntType(string value)
        {
            var dic = this.GetTypeDictionary();
@@ -310,6 +320,11 @@
            }
            return IntType.none;
        }
        /// <summary>
        /// 获取设备名称
        /// </summary>
        /// <param name="key">(1 = 播放器,2 = 功放,3 = 电视,4 = 机顶盒,5 = 投影仪,6 = 万能遥控器)</param>
        /// <returns></returns>
        private string GetValueString(IntType key)
        {
            var dic = this.GetTypeDictionary();