public static T Get <T>(this IDictionary <string, object> d, string key) { object obj = d[key]; if (obj == null) { return(default(T)); } return(TypeParsers.ConvertTo <T>(obj)); }
public static T Get <T>(this IDictionary d, string section, string key) { object obj = d.Get(section, key); if (obj == null) { return(default(T)); } return(TypeParsers.ConvertTo <T>(obj)); }
public static T Get <T>(this IDictionary <string, string> items, string Key) { if (items == null) { return(default(T)); } if (!items.ContainsKey(Key)) { return(default(T)); } return(TypeParsers.ConvertTo <T>(items[Key])); }
public static T GetOrDefault <T>(NameValueCollection collection, string key, T defaultValue) { if (collection == null) { return(defaultValue); } string text = collection[key]; if (string.IsNullOrEmpty(text)) { return(defaultValue); } return(TypeParsers.ConvertTo <T>(text)); }
public static string ToChinese(string x) { double x2 = TypeParsers.ConvertTo <double>(x); return(RMB.ToChinese(x2)); }