示例#1
0
        /// <summary>
        /// Converts map element into a long or returns default value if conversion is not possible.
        /// </summary>
        /// <param name="key">a key of element to get.</param>
        /// <param name="defaultValue">the default value</param>
        /// <returns>long value of the element or default value if conversion is not supported.</returns>
        /// See <see cref="LongConverter.ToLongWithDefault(object, long)"/>
        public long GetAsLongWithDefault(string key, long defaultValue)
        {
            var value = Get(key);

            return(LongConverter.ToLongWithDefault(value, defaultValue));
        }
示例#2
0
 /// <summary>
 /// Converts array element into a long or returns default value if conversion is not possible.
 /// </summary>
 /// <param name="index">an index of element to get.</param>
 /// <param name="defaultValue">the default value</param>
 /// <returns>long value of element or default value if conversion is not supported.</returns>
 /// See <see cref="LongConverter.ToLongWithDefault(object, long)"/>
 public long GetAsLongWithDefault(int index, long defaultValue)
 {
     return(LongConverter.ToLongWithDefault(this[index], defaultValue));
 }
示例#3
0
 public long GetAsLongWithDefault(long defaultValue)
 {
     return(LongConverter.ToLongWithDefault(Value, defaultValue));
 }