Exemplo n.º 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]);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 释放目标名称的实例。该方法的实现在I18nLocalWrapper类中。
 /// </summary>
 /// <param name="targetObj">国际化目标类</param>
 public static void RemoveInstance(object targetObj)
 {
     I18nLocalWrapper.RemoveInstance(targetObj);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 获取I18n处理类的实例。该方法的实现在I18nLocalWrapper类中。
 /// </summary>
 /// <param name="targetObj">国际化目标类的实例</param>
 /// <returns>I18n处理类实例</returns>
 public static I18nEntity GetInstance(object targetObj)
 {
     return(I18nLocalWrapper.GetInstance(targetObj));
 }