xm
2021-12-01 6d73bf6e816570291865674bef8bce8972e4de3f
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -37,11 +37,11 @@
        /// <summary>
        /// 渐变时间修改
        /// </summary>
        //DiyImageSeekBar barFadeTime;
        DiyImageSeekBar barFadeTime;
        /// <summary>
        /// 色温的滑动控件
        /// </summary>
        SeekBarControl barColorTemplatrue;
        CCTSeekBarControl barColorTemplatrue;
        /// <summary>
        /// 开关按钮
        /// </summary>
@@ -53,7 +53,8 @@
        #endregion
        #region 区域变量
        Light light;
        Light lightTemp = new Light();
        Function function;
        Button btnCollection_Out;
        Button btnFunctionName_Out;
        Button btnFromFloor_Out;
@@ -70,10 +71,10 @@
            bodyView = null;
        }
        public ColorTureLampPage(Light func)
        public ColorTureLampPage(Function func)
        {
            bodyView = this;
            light = func;
            function = func;
        }
        public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -82,8 +83,6 @@
            btnFunctionName_Out = btnFunctionNameOut;
            btnFromFloor_Out = btnFromFloorOut;
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            //new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(light,null);
            //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), light);
            controlView = new FrameLayout()
            {
@@ -104,7 +103,7 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                Text = light.name,
                Text = function.name,
            };
            controlView.AddChidren(btnFunctionName);
@@ -117,7 +116,7 @@
                TextColor = CSS_Color.PromptingColor1,
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = light.GetRoomListName()
                Text = function.GetRoomListName()
            };
            controlView.AddChidren(btnFromFoorAndRoom);
@@ -129,29 +128,29 @@
                Height = Application.GetMinRealAverage(40),
                SelectedImagePath = "Collection/CollectionIcon.png",
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = light.collect
                IsSelected = function.collect
            };
            //controlView.AddChidren(btnCollection);
            controlView.AddChidren(btnCollection);
            //2020-12-16 如果是成员隐藏收藏功能
            if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
            {
                controlView.AddChidren(btnCollection);
            }
            //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
            //{
            //    controlView.AddChidren(btnCollection);
            //}
            dimmerBar = new WaveSeekBarOn()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(108),
                Width = Application.GetRealWidth(142 - 16 -16),
                Width = Application.GetRealWidth(142 - 16 - 16),
                Height = Application.GetRealHeight(222),
                BorderColor = 0x00000000,
                CornerRadius = Application.GetRealWidth(20),
                BorderWidth = 0,
                Progress = light.brightness,
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
                IsProgressTextShow = false,
            };
            controlView.AddChidren(dimmerBar);
            if (light.trait_on_off.curValue.ToString() == "on")
            if (function.trait_on_off.curValue.ToString() == "on")
            {
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
            }
@@ -159,25 +158,100 @@
            {
                dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
            }
            dimmerBar.Progress = light.brightness;
            dimmerBar.Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness));
            btnBrightnessText = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = ((100 - light.brightness) * Application.GetRealHeight(222  - 16) / 100) + Application.GetRealWidth(80),
                Y = ((100 - Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80),
                Width = Application.GetRealWidth(56),
                Height = Application.GetRealWidth(46),
                UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                Text = light.brightness + "%",
                Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
            };
            controlView.AddChidren(btnBrightnessText);
            controlView.AddChidren(btnBrightnessText);
            #region 渐变时间调节
            if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null)
            {
                var btnGradualChangeText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = Application.GetRealHeight(306 + 40),
                    Width = Application.GetRealWidth(224),
                    Height = Application.GetRealHeight(21),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    TextID = StringId.SpeedOfChange,
                };
                controlView.AddChidren(btnGradualChangeText);
                var btnGradualChangeMinValuesText = new Button()
                {
                    X = Application.GetRealWidth(35),
                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(5),
                    Width = Application.GetRealWidth(22),
                    Height = Application.GetRealHeight(21),
                    Text = "0s",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                controlView.AddChidren(btnGradualChangeMinValuesText);
                barFadeTime = new DiyImageSeekBar()
                {
                    X = btnGradualChangeMinValuesText.Right,
                    Y = Application.GetRealHeight(360),
                    Width = Application.GetRealWidth(210),
                    Height = Application.GetRealHeight(54),
                    SeekBarViewHeight = Application.GetRealHeight(8),
                    ThumbImagePath = "Public/ThumbImage.png",
                    ThumbImageHeight = Application.GetRealHeight(54),
                    ProgressBarColor = CSS_Color.MainColor,
                    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    ProgressBarUnitSring = "s",
                    MaxValue = 10,
                    Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
                    SeekBarPadding = Application.GetRealWidth(20),
                };
                controlView.AddChidren(barFadeTime);
                var btnGradualChangeMaxValuesText = new Button()
                {
                    X = barFadeTime.Right,
                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(5),
                    Width = Application.GetRealWidth(35),
                    Height = Application.GetRealHeight(21),
                    Text = "10s",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                controlView.AddChidren(btnGradualChangeMaxValuesText);
            }
            #endregion
            #region 色温
            var cctAttr = function.GetAttribute(FunctionAttributeKey.CCT);
            if(cctAttr.min == 0)
            {
                cctAttr.min = 2700;
            }
            if(cctAttr.max == 0)
            {
                cctAttr.max = 6500;
            }
            //色温
            var btnTempClolor = new Button();
            btnTempClolor.X = Application.GetRealWidth(35);
            btnTempClolor.Y = Application.GetRealHeight(306 +60);
            btnTempClolor.Y = Application.GetRealHeight(395);
            btnTempClolor.Width = Application.GetRealWidth(224);
            btnTempClolor.Height = Application.GetRealHeight(21);
            btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
@@ -186,12 +260,13 @@
            btnTempClolor.TextID = StringId.ColorTemperature;
            controlView.AddChidren(btnTempClolor);
            //2700K
            var btnTempClolorMin = new Button();
            btnTempClolorMin.Y = btnTempClolor.Bottom + Application.GetRealHeight(9);
            btnTempClolorMin.Width = Application.GetRealWidth(54);
            btnTempClolorMin.Height = Application.GetRealHeight(21);
            btnTempClolorMin.Text = "2700K";
            btnTempClolorMin.Text = cctAttr.min + "K";
            btnTempClolorMin.TextAlignment = TextAlignment.CenterRight;
            btnTempClolorMin.TextColor = CSS_Color.PromptingColor1;
            btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
@@ -206,11 +281,11 @@
            btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png";
            controlView.AddChidren(btnColorTemplatrueBack);
            //滑动条控件
            barColorTemplatrue = new SeekBarControl();
            barColorTemplatrue = new CCTSeekBarControl();
            barColorTemplatrue.X = btnTempClolorMin.Right;
            barColorTemplatrue.Y = Application.GetRealHeight(340);
            barColorTemplatrue.MinValue = 27;
            barColorTemplatrue.MaxValue = 65;
            barColorTemplatrue.MinValue = cctAttr.min /100;
            barColorTemplatrue.MaxValue = cctAttr.max / 100;
            barColorTemplatrue.ProgressBarColor = 0x00000000;//全部透明
            barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000;
            barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
@@ -219,7 +294,7 @@
            //显示上方的Txt
            barColorTemplatrue.ShowCustomTextView(Application.GetRealWidth(50), CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.FirstLevelTitleColor);
            var cct = 27;
            int.TryParse(light.Attr_CCT.curValue.ToString(), out cct);
            int.TryParse(function.GetAttrState(FunctionAttributeKey.CCT), out cct);
            barColorTemplatrue.Progress = cct;
            //设置初始值
            barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
@@ -233,72 +308,12 @@
            btnTempClolorMax.X = barColorTemplatrue.Right;
            btnTempClolorMax.Width = Application.GetRealWidth(54);
            btnTempClolorMax.Height = Application.GetRealHeight(21);
            btnTempClolorMax.Text = "6500K";
            btnTempClolorMax.Text = cctAttr.max + "K";
            btnTempClolorMax.TextAlignment = TextAlignment.CenterLeft;
            btnTempClolorMax.TextColor = CSS_Color.PromptingColor1;
            btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
            controlView.AddChidren(btnTempClolorMax);
            #endregion
            #region 渐变时间调节
            //var btnGradualChangeText = new Button()
            //{
            //    X = Application.GetRealWidth(35),
            //    Y = Application.GetRealHeight(385),
            //    Width = Application.GetRealWidth(224),
            //    Height = Application.GetRealHeight(21),
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.FirstLevelTitleColor,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    TextID = StringId.SpeedOfChange,
            //};
            //controlView.AddChidren(btnGradualChangeText);
            //var btnGradualChangeMinValuesText = new Button()
            //{
            //    X = Application.GetRealWidth(35),
            //    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(22),
            //    Height = Application.GetRealHeight(21),
            //    Text = "0s",
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.PromptingColor1,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //};
            //controlView.AddChidren(btnGradualChangeMinValuesText);
            //barFadeTime = new DiyImageSeekBar()
            //{
            //    X = btnGradualChangeMinValuesText.Right,
            //    Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(210),
            //    Height = Application.GetRealHeight(54),
            //    SeekBarViewHeight = Application.GetRealHeight(8),
            //    ThumbImagePath = "Public/ThumbImage.png",
            //    ThumbImageHeight = Application.GetRealHeight(54),
            //    ProgressBarColor = CSS_Color.MainColor,
            //    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
            //    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //    ProgressBarUnitSring = "s",
            //    MaxValue = 10,
            //    Progress = light.fadeTime,
            //    SeekBarPadding = Application.GetRealWidth(20),
            //};
            //controlView.AddChidren(barFadeTime);
            //var btnGradualChangeMaxValuesText = new Button()
            //{
            //    X = barFadeTime.Right,
            //    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
            //    Width = Application.GetRealWidth(35),
            //    Height = Application.GetRealHeight(21),
            //    Text = "10s",
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = CSS_Color.PromptingColor1,
            //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            //};
            //controlView.AddChidren(btnGradualChangeMaxValuesText);
            #endregion
            btnSwitch = new Button()
@@ -309,7 +324,7 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = light.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
            };
            controlView.AddChidren(btnSwitch);
@@ -329,10 +344,10 @@
            LoadEventList();
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
            new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(function, actionRefresh);
            new System.Threading.Thread(() =>
            {
                DriverLayer.Control.Ins.SendReadCommand(light);
                DriverLayer.Control.Ins.SendReadCommand(function);
            })
            { IsBackground = true }.Start();
        }
@@ -347,7 +362,8 @@
            var dialogBody = new FrameLayout();
            frameBack.AddChidren(dialogBody);
            dialogBody.MouseUpEventHandler = (sender, e) => {
            dialogBody.MouseUpEventHandler = (sender, e) =>
            {
                frameBack.Close();
            };
@@ -393,12 +409,12 @@
            btnCozyIcon.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 27;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
            };
            //温馨 2700k
@@ -416,12 +432,12 @@
            btnCozy.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 27;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d); barColorTemplatrue.Progress = 27;
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d); barColorTemplatrue.Progress = 27;
                barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
                frameBack.Close();
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/CozyIconOn.png";
@@ -439,12 +455,12 @@
            btnMeetIcon.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 30;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIconOn.png";
            };
@@ -463,12 +479,12 @@
            btnMeet.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 30;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIconOn.png";
            };
@@ -484,12 +500,12 @@
            btnReadIcon.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 65;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ReadIconOn.png";
            };
            //阅读 6500k
@@ -507,12 +523,12 @@
            btnRead.MouseUpEventHandler += (sender, e) =>
            {
                barColorTemplatrue.Progress = 65;
                light.Attr_CCT.curValue = barColorTemplatrue.Progress * 100;
                barColorTemplatrue.SetCustomText(light.Attr_CCT.curValue + "K");
                function.SetAttrState(FunctionAttributeKey.CCT, barColorTemplatrue.Progress * 100);
                barColorTemplatrue.SetCustomText((barColorTemplatrue.Progress * 100) + "K");
                frameBack.Close();
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.CCT, light.Attr_CCT.curValue.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(light, d);
                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ReadIconOn.png";
            };
            btnCozy.IsSelected = false;
@@ -521,257 +537,257 @@
            btnMeetIcon.IsSelected = false;
            btnRead.IsSelected = false;
            btnReadIcon.IsSelected = false;
            if (light.Attr_CCT.curValue.ToString() == "2700")
            if (function.GetAttrState(FunctionAttributeKey.CCT) == "2700")
            {
                btnCozy.IsSelected = true;
                btnCozyIcon.IsSelected = true;
            }
            if (light.Attr_CCT.curValue.ToString() == "3000")
            if (function.GetAttrState(FunctionAttributeKey.CCT) == "3000")
            {
                btnMeet.IsSelected = true;
                btnMeetIcon.IsSelected = true;
            }
            if (light.Attr_CCT.curValue.ToString() == "6500")
            if (function.GetAttrState(FunctionAttributeKey.CCT) == "6500")
            {
                btnRead.IsSelected = true;
                btnReadIcon.IsSelected = true;
            }
        }
    }
    /// <summary>
    /// 左右滑动的进度条控件
    /// </summary>
    public class CCTSeekBarControl : DiyImageSeekBar
    {
        #region ■ 变量声明___________________________
        /// <summary>
        /// 进度值改变,如果要设置初始进度值,此变量要在设置初始进度值之前进行设置(第一个参数0:滑动的时候,1:手指弹起的时候)
        /// </summary>
        public Action<int, int> ProgressChangedEvent = null;
        /// <summary>
        /// 进度条可用时的背景色
        /// </summary>
        private uint ProgressBarEnableColor = 0;
        /// <summary>
        /// 进度条不可用时的背景色(默认灰色)
        /// </summary>
        public uint ProgressBarUnEnableColor = 0xffe8e8e8;
        /// <summary>
        /// 当前可用状态
        /// </summary>
        private bool nowEnable = true;
        /// <summary>
        /// 控件能否使用
        /// </summary>
        public new bool Enable
        {
            set
            {
                //状态没有改变
                if (nowEnable == value) { return; }
                nowEnable = value;
                this.IsClickable = value;
                if (value == true)
                {
                    //原来的颜色
                    base.ProgressBarColor = ProgressBarEnableColor;
                }
                else
                {
                    //灰色
                    base.ProgressBarColor = ProgressBarUnEnableColor;
                }
            }
        }
        /// <summary>
        /// 进度条颜色
        /// </summary>
        public new uint ProgressBarColor
        {
            set
            {
                ProgressBarEnableColor = value;
                base.ProgressBarColor = value;
            }
        }
        private int m_SeekBarPadding = Application.GetRealWidth(20);
        /// <summary>
        /// 进度条与左右两边的边框的边距(重写底层属性)
        /// </summary>
        public new int SeekBarPadding
        {
            set
            {
                m_SeekBarPadding = value;
                base.SeekBarPadding = value;
            }
        }
        private int m_MaxValue = 0;
        /// <summary>
        /// 进度条最大值(重写底层属性)
        /// </summary>
        public new int MaxValue
        {
            set
            {
                m_MaxValue = value;
                base.MaxValue = value;
            }
        }
        private int m_MinValue = 0;
        /// <summary>
        /// 进度条最小值(重写底层属性)
        /// </summary>
        public new int MinValue
        {
            set
            {
                m_MinValue = value;
                base.MinValue = value;
            }
        }
        /// <summary>
        /// 上方显示的文本
        /// </summary>
        private Button btnTopView = null;
        #endregion
        #region ■ 初始化_____________________________
        /// <summary>
        /// 左右滑动的进度条控件
        /// </summary>
        private class SeekBarControl : DiyImageSeekBar
        {
            #region ■ 变量声明___________________________
            /// <summary>
            /// 进度值改变,如果要设置初始进度值,此变量要在设置初始进度值之前进行设置(第一个参数0:滑动的时候,1:手指弹起的时候)
            /// </summary>
            public Action<int, int> ProgressChangedEvent = null;
            /// <summary>
            /// 进度条可用时的背景色
            /// </summary>
            private uint ProgressBarEnableColor = 0;
            /// <summary>
            /// 进度条不可用时的背景色(默认灰色)
            /// </summary>
            public uint ProgressBarUnEnableColor = 0xffe8e8e8;
            /// <summary>
            /// 当前可用状态
            /// </summary>
            private bool nowEnable = true;
            /// <summary>
            /// 控件能否使用
            /// </summary>
            public new bool Enable
            {
                set
                {
                    //状态没有改变
                    if (nowEnable == value) { return; }
                    nowEnable = value;
                    this.IsClickable = value;
                    if (value == true)
                    {
                        //原来的颜色
                        base.ProgressBarColor = ProgressBarEnableColor;
                    }
                    else
                    {
                        //灰色
                        base.ProgressBarColor = ProgressBarUnEnableColor;
                    }
                }
            }
            /// <summary>
            /// 进度条颜色
            /// </summary>
            public new uint ProgressBarColor
            {
                set
                {
                    ProgressBarEnableColor = value;
                    base.ProgressBarColor = value;
                }
            }
            private int m_SeekBarPadding = Application.GetRealWidth(20);
            /// <summary>
            /// 进度条与左右两边的边框的边距(重写底层属性)
            /// </summary>
            public new int SeekBarPadding
            {
                set
                {
                    m_SeekBarPadding = value;
                    base.SeekBarPadding = value;
                }
            }
            private int m_MaxValue = 0;
            /// <summary>
            /// 进度条最大值(重写底层属性)
            /// </summary>
            public new int MaxValue
            {
                set
                {
                    m_MaxValue = value;
                    base.MaxValue = value;
                }
            }
            private int m_MinValue = 0;
            /// <summary>
            /// 进度条最小值(重写底层属性)
            /// </summary>
            public new int MinValue
            {
                set
                {
                    m_MinValue = value;
                    base.MinValue = value;
                }
            }
            /// <summary>
            /// 上方显示的文本
            /// </summary>
            private Button btnTopView = null;
            #endregion
            #region ■ 初始化_____________________________
            /// <summary>
            /// 左右滑动的进度条控件
            /// </summary>
            /// <param name="i_width">宽度,非真实值</param>
            public SeekBarControl(int i_width = 210)
            {
                this.Width = Application.GetRealWidth(i_width);
                this.Height = Application.GetRealHeight(54);
                //圆球的宽度
                this.ThumbImageHeight = Application.GetRealHeight(54);
                this.ThumbImagePath = "Public/ThumbImage.png";
                //进度条的宽度
                this.SeekBarViewHeight = Application.GetRealHeight(8);
                //上方是否显示文本
                this.IsProgressTextShow = false;
                this.Gravity = Gravity.CenterHorizontal;
                //进度条颜色
                this.ProgressBarColor = CSS_Color.MainColor;
                //左右边距
                this.SeekBarPadding = Application.GetRealWidth(20);
                //进度条值改变事件
                this.OnProgressChangedEvent += this.MyProgressChangedEvent;
                //手指弹起事件
                this.OnStopTrackingTouchEvent += this.MyStopTrackingTouchEvent;
            }
            #endregion
            #region ■ 事件_______________________________
            /// <summary>
            /// 进度条值改变事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="value"></param>
            private void MyProgressChangedEvent(object sender, int value)
            {
                if (this.ProgressChangedEvent == null)
                {
                    this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
                    return;
                }
                this.ProgressChangedEvent(0, value);
            }
            /// <summary>
            /// 手指弹起事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="value"></param>
            private void MyStopTrackingTouchEvent(object sender, int value)
            {
                if (this.ProgressChangedEvent == null)
                {
                    this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
                    return;
                }
                //弹起事件不需要判断时间
                this.ProgressChangedEvent(1, value);
            }
            #endregion
            #region ■ 自定义上方显示文本_________________
            /// <summary>
            /// 在上方显示自定义文本
            /// </summary>
            /// <param name="i_width">宽度(真实值)</param>
            /// <param name="textSize">文字大小</param>
            /// <param name="textColor">文字颜色</param>
            public void ShowCustomTextView(int i_width, int textSize, uint textColor)
            {
                if (this.btnTopView != null) { return; }
                int contrHeight = Application.GetRealHeight(24);
                this.btnTopView = new Button();
                btnTopView.Width = i_width;
                btnTopView.Height = contrHeight;
                btnTopView.TextColor = textColor;
                btnTopView.TextSize = textSize;
                btnTopView.TextAlignment = TextAlignment.Center;
                btnTopView.Y = this.Y - contrHeight + Application.GetRealHeight(20);
                //初始化时,X轴可以不用理会
                this.Parent.AddChidren(btnTopView);
            }
            /// <summary>
            /// 设置自定义文本信息
            /// </summary>
            /// <param name="i_text"></param>
            public void SetCustomText(string i_text)
            {
                if (this.btnTopView == null) { return; }
                this.btnTopView.Text = i_text;
                //滑条最左边的距离
                int XX = this.X + this.m_SeekBarPadding;
                //当前滑条所在的大致百分比
                int tempValue = this.Progress - this.m_MinValue;
                if (tempValue < 0) { tempValue = 0; }
                decimal persent = (decimal)tempValue / (this.m_MaxValue - this.m_MinValue);
                //当前滑条所在的大致位置
                XX += (int)((this.Width - this.m_SeekBarPadding * 2) * persent);
                //因为要居中,所以减掉自定义控件的宽度的一般
                XX = XX - this.btnTopView.Width / 2;
                this.btnTopView.X = XX;
            }
            #endregion
            #region ■ 一般方法___________________________
            /// <summary>
            /// 控件摧毁
            /// </summary>
            public override void RemoveFromParent()
            {
                this.ProgressChangedEvent = null;
                base.RemoveFromParent();
            }
            #endregion
        /// <param name="i_width">宽度,非真实值</param>
        public CCTSeekBarControl(int i_width = 210)
        {
            ProgressChangeDelayTime = 30;
            this.Width = Application.GetRealWidth(i_width);
            this.Height = Application.GetRealHeight(54);
            //圆球的宽度
            this.ThumbImageHeight = Application.GetRealHeight(54);
            this.ThumbImagePath = "Public/ThumbImage.png";
            //进度条的宽度
            this.SeekBarViewHeight = Application.GetRealHeight(8);
            //上方是否显示文本
            this.IsProgressTextShow = false;
            this.Gravity = Gravity.CenterHorizontal;
            //进度条颜色
            this.ProgressBarColor = CSS_Color.MainColor;
            //左右边距
            this.SeekBarPadding = Application.GetRealWidth(20);
            //进度条值改变事件
            this.OnProgressChangedEvent += this.MyProgressChangedEvent;
            //手指弹起事件
            this.OnStopTrackingTouchEvent += this.MyStopTrackingTouchEvent;
        }
        #endregion
        #region ■ 事件_______________________________
        /// <summary>
        /// 进度条值改变事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="value"></param>
        private void MyProgressChangedEvent(object sender, int value)
        {
            if (this.ProgressChangedEvent == null)
            {
                this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
                return;
            }
            this.ProgressChangedEvent(0, value);
        }
        /// <summary>
        /// 手指弹起事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="value"></param>
        private void MyStopTrackingTouchEvent(object sender, int value)
        {
            if (this.ProgressChangedEvent == null)
            {
                this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
                return;
            }
            //弹起事件不需要判断时间
            this.ProgressChangedEvent(1, value);
        }
        #endregion
        #region ■ 自定义上方显示文本_________________
        /// <summary>
        /// 在上方显示自定义文本
        /// </summary>
        /// <param name="i_width">宽度(真实值)</param>
        /// <param name="textSize">文字大小</param>
        /// <param name="textColor">文字颜色</param>
        public void ShowCustomTextView(int i_width, int textSize, uint textColor)
        {
            if (this.btnTopView != null) { return; }
            int contrHeight = Application.GetRealHeight(24);
            this.btnTopView = new Button();
            btnTopView.Width = i_width;
            btnTopView.Height = contrHeight;
            btnTopView.TextColor = textColor;
            btnTopView.TextSize = textSize;
            btnTopView.TextAlignment = TextAlignment.Center;
            btnTopView.Y = this.Y - contrHeight + Application.GetRealHeight(20);
            //初始化时,X轴可以不用理会
            this.Parent.AddChidren(btnTopView);
        }
        /// <summary>
        /// 设置自定义文本信息
        /// </summary>
        /// <param name="i_text"></param>
        public void SetCustomText(string i_text)
        {
            if (this.btnTopView == null) { return; }
            this.btnTopView.Text = i_text;
            //滑条最左边的距离
            int XX = this.X + this.m_SeekBarPadding;
            //当前滑条所在的大致百分比
            int tempValue = this.Progress - this.m_MinValue;
            if (tempValue < 0) { tempValue = 0; }
            decimal persent = (decimal)tempValue / (this.m_MaxValue - this.m_MinValue);
            //当前滑条所在的大致位置
            XX += (int)((this.Width - this.m_SeekBarPadding * 2) * persent);
            //因为要居中,所以减掉自定义控件的宽度的一般
            XX = XX - this.btnTopView.Width / 2;
            this.btnTopView.X = XX;
        }
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
        /// 控件摧毁
        /// </summary>
        public override void RemoveFromParent()
        {
            this.ProgressChangedEvent = null;
            base.RemoveFromParent();
        }
        #endregion
    }
}
}