| | |
| | | /// </summary>
|
| | | public Action FinishInputEvent = null;
|
| | | /// <summary>
|
| | | /// 最大输入长度(目前只针对按下回车键时进行检测,超过时,不会调用FinishInputEvent)
|
| | | /// </summary>
|
| | | public int MaxByte = 0;
|
| | | /// <summary>
|
| | | /// 文本是否为黑色字体
|
| | | /// </summary>
|
| | | private bool IsTextBlack = false;
|
| | |
| | | /// <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();
|