CgwMonitorManage.SmcError.ErrorInfo.ToFormatedErrDesc C# (CSharp) Method

ToFormatedErrDesc() public method

格式化错误描述信息,填充错误参数
public ToFormatedErrDesc ( DelegateGetErrorDesc delegateHandler, int langId, string errDesc ) : string
delegateHandler DelegateGetErrorDesc 委托线程
langId int langId
errDesc string 带格式的错误描述,需要补充参数
return string
        public string ToFormatedErrDesc(DelegateGetErrorDesc delegateHandler, int langId, string errDesc)
        {
            //获取标识符以及标识符对应的替代值字典
            Dictionary<string, string> errParams = this.GetErrorInfo(delegateHandler, langId, errDesc);

            string formatedString = errDesc;

            if (null != errParams || 0 != errParams.Count)
            {
                Dictionary<string, string>.KeyCollection paramKey = errParams.Keys;

                //填充描述字串参数
                foreach (string s in paramKey)
                {
                    formatedString = errDesc.Replace(s, errParams[s]);
                    errDesc = formatedString;
                }
            }

            //处理批量操作的错误描述
            if (null != this.MultipleErrs && this.MultipleErrs.Count != 0)
            {
                formatedString += "<br />";
                foreach (SmcErr err in this.MultipleErrs)
                {
                    //DTS2012080206396 批量添加失败报错,错误提示有"<br />"
                    //将这里的"<br />"去掉
                    formatedString += err.ToFomatedErrDesc(langId);
                }
            }

            return formatedString;
        }