HDL Home App 第二版本 旧平台金堂用 正在使用
chenqiyang
2022-06-22 dc0309e64f02227d8e1468b7326c07955f804612
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SearchEditText.cs
old mode 100755 new mode 100644
@@ -10,8 +10,8 @@
    public class SearchTextControl : FrameLayout
    {
        #region ■ 变量声明__________________________
        /// <summary>
        /// 为了对应子线程
        /// <summary>
        /// 为了对应子线程
        /// </summary>
        private string m_Text = string.Empty;
        /// <summary>
@@ -21,13 +21,13 @@
        public string Text
        {
            get
            {
            {
                return m_Text;
            }
            set
            {
                this.m_Text = value;
                txtSearch.Text = this.m_Text;
            set
            {
                this.m_Text = value;
                txtSearch.Text = this.m_Text;
            }
        }
        /// <summary>
@@ -38,13 +38,13 @@
        /// 回调函数
        /// </summary>
        private Action<string> actionMethod = null;
        /// <summary>
        /// 没有输入键值的显示文本
        /// <summary>
        /// 没有输入键值的显示文本
        /// </summary>
        private string tipText = string.Empty;
        private string tipText = string.Empty;
        #endregion
        #region ■ 初始化____________________________
        /// <summary>
        /// 制作一个根据键值进行搜索的控件
@@ -58,9 +58,9 @@
            this.tipText = i_tipText;
            //桌布控件
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealHeight(height);
            this.Gravity = Gravity.CenterHorizontal;
            this.Radius = (uint)Application.GetMinRealAverage(6);
            this.Height = Application.GetRealHeight(height);
            this.Gravity = Gravity.CenterHorizontal;
            this.Radius = (uint)Application.GetRealHeight(17);
            this.BackgroundColor = 0xfff8f7f7;
        }
@@ -69,17 +69,17 @@
        /// </summary>
        /// <param name="action">回调函数:值是输入的关键字</param>
        private void InitControl(Action<string> action)
        {
            //搜索图标
            var btnIcon = new IconViewControl(52);
            btnIcon.Gravity = Gravity.CenterVertical;
            btnIcon.X = ControlCommonResourse.XXLeft;
        {
            //搜索图标
            var btnIcon = new IconViewControl(52);
            btnIcon.Gravity = Gravity.CenterVertical;
            btnIcon.X = ControlCommonResourse.XXLeft;
            btnIcon.UnSelectedImagePath = "Item/Search.png";
            this.AddChidren(btnIcon);
            //取消
            var btnCancel = new IconViewControl(58);
            btnCancel.X = this.Width - ControlCommonResourse.XXLeft / 2 - btnCancel.IconSize;
            this.AddChidren(btnIcon);
            //取消
            var btnCancel = new IconViewControl(58);
            btnCancel.X = this.Width - ControlCommonResourse.XXLeft / 2 - btnCancel.IconSize;
            btnCancel.UnSelectedImagePath = "Item/CancelIcon.png";
            btnCancel.Gravity = Gravity.CenterVertical;
            this.AddChidren(btnCancel);
@@ -91,11 +91,11 @@
            //输入文本
            int textWidth = btnCancel.X - Application.GetRealWidth(132 + 10);
            txtSearch = new TextInputControl(textWidth, Application.GetRealHeight(49), false);
            txtSearch.X = Application.GetRealWidth(132);
            txtSearch.X = Application.GetRealWidth(132);
            txtSearch.PlaceholderText = this.tipText;
            txtSearch.Gravity = Gravity.CenterVertical;
            txtSearch.TextSize = 12;
            txtSearch.PlaceholderTextColor = UserCenterColor.Current.TextGrayColor1;
            txtSearch.PlaceholderTextColor = UserCenterColor.Current.TextGrayColor1;
            this.AddChidren(txtSearch);
            string oldText = string.Empty;
@@ -113,11 +113,11 @@
                //允许执行回调函数
                this.isCanSearch = true;
            };
        }
        }
        #endregion
        #region ■ 绑定事件__________________________
        /// <summary>
        /// 绑定事件
        /// </summary>
@@ -134,9 +134,9 @@
        }
        #endregion
        #region ■ 开启线程__________________________
        /// <summary>
        /// 能否执行搜索
        /// </summary>
@@ -150,7 +150,7 @@
        /// </summary>
        private void StartSearchKeysThead()
        {
            new System.Threading.Thread(() =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                while (this.Parent != null)
                {
@@ -176,20 +176,19 @@
                    //如果当前的检索键值与下一个检索键值不一样的话
                    //那就说明,用户再次输入了键值,这个时候,让线程继续跑下去
                }
            })
            { IsBackground = true }.Start();
        }
            });
        }
        #endregion
        #region ■ 控件摧毁__________________________
        /// <summary>
        /// 控件摧毁
        /// <summary>
        /// 控件摧毁
        /// </summary>
        public override void RemoveFromParent()
        {
            actionMethod = null;
            base.RemoveFromParent();
        public override void RemoveFromParent()
        {
            actionMethod = null;
            base.RemoveFromParent();
        }
        #endregion