黄学彪
2019-11-04 c7698e163e43cea9e7f8ee45f8e3f91c9265cca4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
@@ -134,12 +134,10 @@
                catch (Exception ex)
                {
                    //出现未知错误,数据丢失
                    var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost));
                    var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
                    alert.Show();
                    //Log出力
                    string msg = ex.Message + "\r\n";
                    msg += ex.TargetSite.ToString();
                    HdlLogLogic.Current.WriteLog(-1, msg);
                    HdlLogLogic.Current.WriteLog(ex);
                }
            }
        }
@@ -220,18 +218,19 @@
            int byteLength = 0;
            for (int i = 0; i < i_text.Length; i++)
            {
                int length = Encoding.UTF8.GetBytes(i_text[i].ToString()).Length;
                if (length == 1)
                {
                    //英文
                    byteLength += length;
                    continue;
                }
                //中文(暂时用中文对应)
                byteLength += Encoding.GetEncoding("gb2312").GetBytes(i_text[i].ToString()).Length;
                byteLength += Encoding.UTF8.GetBytes(i_text[i].ToString()).Length;
                //int length = Encoding.UTF8.GetBytes(i_text[i].ToString()).Length;
                //if (length == 1)
                //{
                //    //英文
                //    byteLength += length;
                //    continue;
                //}
                ////中文(暂时用中文对应)
                //byteLength += Encoding.GetEncoding("gb2312").GetBytes(i_text[i].ToString()).Length;
            }
            int realWidth = byteLength * (int)textSize;
            return Application.GetRealWidth(realWidth);
            return Application.GetRealWidth(realWidth + 20);
        }
        /// <summary>
@@ -241,7 +240,7 @@
        {
            var btnShadow = new PicViewControl(this.Width, Application.GetMinRealAverage(45), false);
            btnShadow.X = this.X;
            btnShadow.Y = this.Bottom - 1;
            btnShadow.Y = this.Bottom;
            btnShadow.UnSelectedImagePath = "Item/BottomShadow.png";
            this.Parent.AddChidren(btnShadow);
        }