Пример #1
0
 /// <summary>
 /// 获取I18n处理类的实例
 /// </summary>
 /// <param name="targetName">国际化目标名称</param>
 /// <returns>I18n处理类实例</returns>
 public static I18nEntity GetInstance(string targetName)
 {
     lock (_languageType)
     {
         if (null == _encode)
         {
             _languageType = I18nLocalWrapper.GetLanguageType();
             _encode       = I18nLocalWrapper.GetFileEncoding();
         }
         if (!_targetNameToInst.ContainsKey(targetName))
         {
             _targetNameToInst[targetName] = new I18nEntity(targetName);
         }
     }
     return(_targetNameToInst[targetName]);
 }
Пример #2
0
 /// <summary>
 /// 释放本地化i18n定制的实现类
 /// </summary>
 /// <param name="targetObj">国际化目标类</param>
 /// <returns></returns>
 public static void RemoveInstance(object targetObj)
 {
     I18nEntity.RemoveInstance(_getTargetName(targetObj));
 }
Пример #3
0
 /// <summary>
 /// 获取本地化i18n定制的实现类
 /// </summary>
 /// <param name="targetObj"></param>
 /// <returns>目标类型I18n实例</returns>
 public static I18nEntity GetInstance(object targetObj)
 {
     return(I18nEntity.GetInstance(_getTargetName(targetObj)));
 }