tzy
2021-05-14 0fa1534827bd21d763216550d11006fc1441c6cb
HDL_ON/UI/UI0-Stan/Form/DeviceFunctionCardCommonForm.cs
@@ -23,6 +23,10 @@
        /// </summary>
        public Action SettionFinishEvent = null;
        /// <summary>
        /// 左右翻页的控件的事件
        /// </summary>
        public Action<int> PageChangeEvent = null;
        /// <summary>
        /// 左右整个翻页的控件
        /// </summary>
        private PageLayout pageLayout = null;
@@ -95,6 +99,7 @@
            {
                //设置底部两个按钮的状态
                this.SetBottomTwoButtonStatu();
                this.PageChangeEvent?.Invoke(index);
            };
            //初始化第一个索引的桌布
@@ -213,6 +218,10 @@
                this.pageLayout.PageIndex = 0;
                //设置底部两个按钮的状态
                this.SetBottomTwoButtonStatu();
                if (this.FrameWhiteCentet2 != null && this.pageLayout.ScrollEnabled == false)
                {
                    this.pageLayout.ScrollEnabled = true;
                }
            };
            this.btnBottomTwo = new NormalViewControl(14, 6, true);
            btnBottomTwo.X = btnBottomOne.Right + Application.GetRealWidth(8);
@@ -225,6 +234,10 @@
                this.pageLayout.PageIndex = 1;
                //设置底部两个按钮的状态
                this.SetBottomTwoButtonStatu();
                if (this.FrameWhiteCentet2 != null && this.pageLayout.ScrollEnabled == false)
                {
                    this.pageLayout.ScrollEnabled = true;
                }
            };
        }
@@ -249,7 +262,40 @@
        #endregion
        #region ■ 界面关闭___________________________
        /// <summary>
        /// 界面关闭
        /// </summary>
        public override void CloseFormBefore()
        {
            base.CloseFormBefore();
            this.SettionFinishEvent = null;
            this.PageChangeEvent = null;
        }
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
        /// 获取头部右边的【设置】图标控件
        /// </summary>
        /// <returns></returns>
        public PicViewControl GetTopSettingIcon()
        {
            for (int i = 0; i < topFrameLayout.ChildrenCount; i++)
            {
                var myView = topFrameLayout.GetChildren(i);
                if (myView == null || myView.Name != "btnSetting")
                {
                    continue;
                }
                return myView as PicViewControl;
            }
            return null;
        }
        /// <summary>
        /// 添加头部【设置】的图标
@@ -258,18 +304,20 @@
        /// <param name="btnHigherDeviceName">上一级界面的设备名字控件(原来on的框架太坑)</param>
        private void AddTopSettingIcon(Button btnHigherDeviceName, Button btnHigherRoom)
        {
            //如果是成员没有功能
            if (DB_ResidenceData.Instance.CurrentRegion.IsOthreShare == true)
            {
                return;
            }
            //设置图标
            //设置图标(门锁界面需要借用这个图标的X轴和Y轴,所以加进来)
            var btnSetting = new PicViewControl(28, 28);
            btnSetting.X = Application.GetRealWidth(337);
            btnSetting.Y = Application.GetRealHeight(9);
            btnSetting.UnSelectedImagePath = "Public/FuncInfoSetIcon.png";
            btnSetting.Name = "btnSetting";
            topFrameLayout.AddChidren(btnSetting);
            //如果是成员没有功能
            if (DB_ResidenceData.Instance.CurrentRegion.IsOthreShare == true)
            {
                btnSetting.Visible = false;
            }
            btnSetting.ButtonClickEvent += (sender, e) =>
            {
                var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>