FrameworkI18N.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // <author></author>
  2. // <date></date>
  3. // <description></description>
  4. using System.Resources;
  5. namespace ERP.Framework.Resource
  6. {
  7. public class FrameworkI18N
  8. {
  9. private static readonly ResourceManager _resourceManager = new ResourceManager(typeof(FrameworkI18N));
  10. /// <summary>
  11. /// 无法获取当前Ip
  12. /// </summary>
  13. public static string? NoIP => GetString("NoIP");
  14. /// <summary>
  15. /// token 失效
  16. /// </summary>
  17. public static string? TokenValidate => GetString("TokenValidate");
  18. /// <summary>
  19. /// 长时间未操作
  20. /// </summary>
  21. public static string? IdleTimeOut => GetString("IdleTimeOut");
  22. /// <summary>
  23. /// 被踢下线
  24. /// </summary>
  25. public static string? KickedOut => GetString("KickedOut");
  26. /// <summary>
  27. /// 被顶下线
  28. /// </summary>
  29. public static string? ConcurrentLogin => GetString("ConcurrentLogin");
  30. /// <summary>
  31. /// token 失效
  32. /// </summary>
  33. public static string? NoPermission => GetString("NoPermission");
  34. /// <summary>
  35. /// 无法获得当前用户
  36. /// </summary>
  37. public static string? NoUser => GetString("NoUser");
  38. /// <summary>
  39. /// 获取对应的I18N消息
  40. /// </summary>
  41. /// <param name="name"></param>
  42. /// <returns></returns>
  43. public static string? GetString(string name)
  44. {
  45. return _resourceManager.GetString(name);
  46. }
  47. }
  48. }