public static T?ParsePrimitive <T>(string value) where T : struct, IConvertible { return(NameValueCollectionExtensions.ParsePrimitive <T>(value, null)); }
/// <summary> /// Provides culture-invariant parsing of byte, int, double, float, bool, and enum values. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="name"></param> /// <param name="defaultValue"></param> /// <returns></returns> public T Get <T>(string name, T defaultValue) where T : struct, IConvertible { return(NameValueCollectionExtensions.ParsePrimitive <T>(this[name], defaultValue).Value); }
public static T ParsePrimitive <T>(string value, T defaultValue) where T : struct, IConvertible { return(NameValueCollectionExtensions.ParsePrimitive <T>(value, defaultValue).Value); }