| | |
| | | var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost));
|
| | | 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);
|