StringResources.cs 1.8 KB

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