| | |
| | | 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);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | 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>
|
| | |
| | | {
|
| | | 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);
|
| | | }
|