From 18a7f9f40e5fab3bee5d4ac3d8fd0273dea052d6 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期日, 26 四月 2020 12:05:28 +0800
Subject: [PATCH] 先上传一个非最新的版本
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs
index 6d9db74..23821be 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/TextInputExControl.cs
@@ -16,6 +16,10 @@
/// </summary>
public Action FinishInputEvent = null;
/// <summary>
+ /// 鏈�澶ц緭鍏ラ暱搴�(鐩墠鍙拡瀵规寜涓嬪洖杞﹂敭鏃惰繘琛屾娴�,瓒呰繃鏃�,涓嶄細璋冪敤FinishInputEvent)
+ /// </summary>
+ public int MaxByte = 0;
+ /// <summary>
/// 鏂囨湰鏄惁涓洪粦鑹插瓧浣�
/// </summary>
private bool IsTextBlack = false;
@@ -63,6 +67,18 @@
/// <param name="view"></param>
private void EditorEnterEvent(View view)
{
+ if (this.MaxByte != 0)
+ {
+ if (Encoding.UTF8.GetBytes(this.Text.Trim()).Length > this.MaxByte)
+ {
+ //杈撳叆鍐呭杩囬暱,鏈�澶0}瀛楄妭
+ string msg = Language.StringByID(R.MyInternationalizationString.uInputContentIsOverLengthMsg);
+ msg.Replace("{0}", this.MaxByte.ToString());
+ var contr = new ShowMsgControl(ShowMsgType.Error, msg);
+ contr.Show();
+ return;
+ }
+ }
this.TextColor = UserCenterColor.Current.TextGrayColor3;
this.IsTextBlack = false;
this.FinishInputEvent?.Invoke();
--
Gitblit v1.8.0