Argentini.Halide.H3Config.GetKeyAsInt64 C# (CSharp) Method

GetKeyAsInt64() public static method

Retrieve the value of an application setting from the Web.config file.
public static GetKeyAsInt64 ( String keyName, System.Int64 defaultValue, String sectionName ) : System.Int64
keyName String Key name for which a value should be returned.
defaultValue System.Int64 Default value to use if the key is not found.
sectionName String Section name within the Web.config file.
return System.Int64
        public static Int64 GetKeyAsInt64(String keyName, Int64 defaultValue, String sectionName)
        {
            NameValueCollection settings = (NameValueCollection)ConfigurationManager.GetSection(sectionName);
            Int64? value = null;

            if (settings[keyName] != null)
            {
                if (H3Identify.IsPureNumeric(settings[keyName].ToString()))
                {
                    value = Convert.ToInt64(settings[keyName]);
                }
            }

            if (value == null)
            {
                value = defaultValue;
            }

            return (Int64)value;
        }

Same methods

H3Config::GetKeyAsInt64 ( String keyName, System.Int64 defaultValue ) : System.Int64
H3Config::GetKeyAsInt64 ( String keyName, String defaultValue ) : System.Int64
H3Config::GetKeyAsInt64 ( String keyName, String defaultValue, String sectionName ) : System.Int64
H3Config::GetKeyAsInt64 ( String keyName ) : Int64?