From 0bf9e65bc3ba98391e7835c922b15baab3c77876 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 01 六月 2020 14:59:39 +0800
Subject: [PATCH] 上传一个合并的版本

---
 ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs b/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
index 5c002e7..e6cc62c 100755
--- a/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
+++ b/ZigbeeApp/Shared/Phone/CommonForm/CommonFormBase.cs
@@ -143,7 +143,8 @@
         /// </summary>
         /// <param name="gateWay">缃戝叧瀵硅薄</param>
         /// <param name="online">鍦ㄧ嚎鐘舵�佸彉鏇村悗鐨勭姸鎬�</param>
-        public virtual void GatewayOnlinePush(ZigBee.Device.ZbGateway gateWay, bool online)
+        /// <param name="hadGwOnline">2020.05.25杩藉姞:姝や綇瀹呮槸鍚︽嫢鏈夌綉鍏冲湪绾�</param>
+        public virtual void GatewayOnlinePush(ZigBee.Device.ZbGateway gateWay, bool online, bool hadGwOnline)
         {
         }
 
@@ -289,6 +290,61 @@
 
         #endregion
 
+        #region 鈻� 妫�娴嬮敊璇痏__________________________
+
+        /// <summary>
+        /// 妫�娴嬬晫闈㈢殑閿欒
+        /// </summary>
+        /// <returns></returns>
+        public bool CheckForm()
+        {
+            //妫�娴嬫帶浠�
+            return this.CheckControl(this);
+        }
+
+        /// <summary>
+        /// 妫�娴嬫帶浠�
+        /// </summary>
+        /// <param name="view"></param>
+        /// <returns></returns>
+        private bool CheckControl(View view)
+        {
+            //绗竴涓繘鏉ヨ偗瀹氭槸 ViewGroup
+            if (view is ViewGroup)
+            {
+                var viewGroup = (ViewGroup)view;
+                for (int i = 0; i < viewGroup.ChildrenCount; i++)
+                {
+                    var myView = viewGroup.GetChildren(i);
+                    if (myView is ViewGroup)
+                    {
+                        //閫掑綊妫�娴�
+                        bool result = this.CheckControl(myView);
+                        if (result == false)
+                        {
+                            return false;
+                        }
+                        continue;
+                    }
+                    if (myView is TextInputControl)
+                    {
+                        //妫�娴嬭緭鍏ユ鐨勯敊璇�
+                        var error = ((TextInputControl)myView).CheckError();
+                        if (error != null)
+                        {
+                            this.ShowMassage(ShowMsgType.Tip, error);
+                            ((TextInputControl)myView).OnError = true;
+                            return false;
+                        }
+                        ((TextInputControl)myView).OnError = false;
+                    }
+                }
+            }
+            return true;
+        }
+
+        #endregion
+
         #region 鈻� 鍙嶅皠鏂规硶___________________________
 
         /// <summary>

--
Gitblit v1.8.0