/// <summary> /// Retrieves application configuration value for specified key. /// </summary> /// <param name="psKey">Configuration key to search for.</param> /// <param name="pnDefaultValue">Value to return if key not found.</param> /// <returns>Double value defined by the key if key is found; otherwise psDefaultValue is returned.</returns> static public double GetDoubleValueFromConfigFile(string psKey, double pnDefaultValue) { string sKey = psKey; if (sKey == null) { sKey = string.Empty; } double nConfigValue = (double)0.0; string sConfigValue = GetConfigValue(psKey); nConfigValue = AppTextGlobals.ConvertStringToDouble(sConfigValue, pnDefaultValue); return(nConfigValue); }
/// <summary> /// Retrieves application configuration value for specified key. /// </summary> /// <param name="psKey">Configuration key to search for.</param> /// <param name="pnDefaultValue">Value to return if key not found.</param> /// <returns>Long value defined by the key if key is found; otherwise psDefaultValue is returned.</returns> static public long GetLongValueFromConfigFile(string psKey, long pnDefaultValue) { string sKey = psKey; if (sKey == null) { sKey = string.Empty; } long nConfigValue = 0; string sConfigValue = GetConfigValue(psKey); nConfigValue = AppTextGlobals.ConvertStringToLong(sConfigValue, pnDefaultValue); return(nConfigValue); }
/// <summary> /// Retrieves application configuration value for specified key. /// </summary> /// <param name="psKey">Configuration key to search for.</param> /// <param name="pnDefaultValue">Value to return if key not found.</param> /// <returns>Float value defined by the key if key is found; otherwise psDefaultValue is returned.</returns> static public float GetFloatValueFromConfigFile(string psKey, float pnDefaultValue) { string sKey = psKey; if (sKey == null) { sKey = string.Empty; } float nConfigValue = (float)0.0; string sConfigValue = GetConfigValue(psKey); nConfigValue = AppTextGlobals.ConvertStringToFloat(sConfigValue, pnDefaultValue); return(nConfigValue); }
/// <summary> /// Retrieves application configuration value for specified key. /// </summary> /// <param name="psKey">Configuration key to search for.</param> /// <param name="pnDefaultValue">Value to return if key not found.</param> /// <returns>Int value defined by the key if key is found; otherwise psDefaultValue is returned.</returns> static public int GetIntValueFromConfigFile(string psKey, int pnDefaultValue) { string sKey = psKey; if (sKey == null) { sKey = string.Empty; } int nConfigValue = 0; string sConfigValue = GetConfigValue(psKey); nConfigValue = AppTextGlobals.ConvertStringToInt(sConfigValue, pnDefaultValue); return(nConfigValue); }
/// <summary> /// Retrieves application configuration value for specified key. /// </summary> /// <param name="psKey">Configuration key to search for.</param> /// <param name="psDefaultValue">Value to return if key not found.</param> /// <returns>Boolean value defined by the key if key is found; otherwise psDefaultValue is returned.</returns> static public bool GetBooleanValueFromConfigFile(string psKey, string psDefaultValue) { string sKey = psKey; if (sKey == null) { sKey = string.Empty; } bool bConfigValue = true; string sConfigValue = GetConfigValue(psKey); if (sConfigValue.Length == 0) { sConfigValue = psDefaultValue; } bConfigValue = AppTextGlobals.ConvertStringToBoolean(sConfigValue, psDefaultValue); return(bConfigValue); }