StringResources.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace TFT_MelsecMcNet
  5. {
  6. /*******************************************************************************
  7. *
  8. * 用于显示和保存的数据信息,未来支持中英文
  9. *
  10. * Used to the return result class in the synchronize communication and communication for industrial Ethernet
  11. *
  12. *******************************************************************************/
  13. /// <summary>
  14. /// 系统的字符串资源及多语言管理中心 ->
  15. /// System string resource and multi-language management Center
  16. /// </summary>
  17. public static class StringResources
  18. {
  19. #region Constractor
  20. static StringResources()
  21. {
  22. if (System.Globalization.CultureInfo.CurrentCulture.ToString().StartsWith("zh"))
  23. {
  24. SetLanguageChinese();
  25. }
  26. else
  27. {
  28. SeteLanguageEnglish();
  29. }
  30. }
  31. #endregion
  32. /// <summary>
  33. /// 获取或设置系统的语言选项 ->
  34. /// Gets or sets the language options for the system
  35. /// </summary>
  36. public static DefaultLanguage Language = new();
  37. /// <summary>
  38. /// 将语言设置为中文 ->
  39. /// Set the language to Chinese
  40. /// </summary>
  41. public static void SetLanguageChinese()
  42. {
  43. Language = new DefaultLanguage();
  44. }
  45. /// <summary>
  46. /// 将语言设置为英文 ->
  47. /// Set the language to English
  48. /// </summary>
  49. public static void SeteLanguageEnglish()
  50. {
  51. Language = new English();
  52. }
  53. }
  54. }