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; } } } }