123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System.Configuration;
- namespace GDNXFD.Data
- {
- public class GlobalVar
- {
- private GlobalVar()
- {
- }
- private static string eDosServerIP;
- private static ushort eDosServerPort;
- private static int pollingInterval;
- public static string EDosServerIP
- {
- get
- {
- if (string.IsNullOrWhiteSpace(eDosServerIP))
- eDosServerIP = ConfigurationSettings.AppSettings["EDosServerIP"];
- return eDosServerIP;
- }
- set { eDosServerIP = value; }
- }
- public static ushort EDosServerPort
- {
- get
- {
- if (eDosServerPort < 1024)
- {
- string strPort = ConfigurationSettings.AppSettings["EDosServerPort"];
- if (!ushort.TryParse(strPort, out eDosServerPort))
- {
- eDosServerPort = 10010;
- }
- }
- return eDosServerPort;
- }
- set { eDosServerPort = value; }
- }
- public static int PollingInterval
- {
- get
- {
- string strPort = ConfigurationSettings.AppSettings["PollingInterval"];
- if (!int.TryParse(strPort, out pollingInterval))
- {
- pollingInterval = 5;
- }
- return pollingInterval;
- }
- set { pollingInterval = value; }
- }
- }
- }
|