GlobalVar.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System.Configuration;
  2. namespace GDNXFD.Data
  3. {
  4. public class GlobalVar
  5. {
  6. private GlobalVar()
  7. {
  8. }
  9. private static string eDosServerIP;
  10. private static ushort eDosServerPort;
  11. private static int pollingInterval;
  12. public static string EDosServerIP
  13. {
  14. get
  15. {
  16. if (string.IsNullOrWhiteSpace(eDosServerIP))
  17. eDosServerIP = ConfigurationSettings.AppSettings["EDosServerIP"];
  18. return eDosServerIP;
  19. }
  20. set { eDosServerIP = value; }
  21. }
  22. public static ushort EDosServerPort
  23. {
  24. get
  25. {
  26. if (eDosServerPort < 1024)
  27. {
  28. string strPort = ConfigurationSettings.AppSettings["EDosServerPort"];
  29. if (!ushort.TryParse(strPort, out eDosServerPort))
  30. {
  31. eDosServerPort = 10010;
  32. }
  33. }
  34. return eDosServerPort;
  35. }
  36. set { eDosServerPort = value; }
  37. }
  38. public static int PollingInterval
  39. {
  40. get
  41. {
  42. string strPort = ConfigurationSettings.AppSettings["PollingInterval"];
  43. if (!int.TryParse(strPort, out pollingInterval))
  44. {
  45. pollingInterval = 5;
  46. }
  47. return pollingInterval;
  48. }
  49. set { pollingInterval = value; }
  50. }
  51. }
  52. }