public static IEnumerable <TTo> Convert <TFrom, TTo>(IEnumerable <TFrom> list, Func <TFrom, TTo> func) { return(Safe.Run(() => list.Select(func), new List <TTo>(), true)); }
public static IEnumerable <T> OrderBy <T>(IEnumerable <T> list, Func <T, string> func) { return(Safe.Run(() => list.OrderBy(func), new List <T>() as IEnumerable <T>, true)); }
public static RegionInfo ToRegionInfo(CultureInfo info) { return(info is null ? null : Safe.Run(() => new RegionInfo(info.LCID), null)); }
public static IEnumerable <T> Distinct <T>(IEnumerable <T> list) { return(Safe.Run(list.Distinct, new List <T>(), true)); }
public static Assembly AssemblyByName(string name) { return(Safe.Run(() => Assembly.Load(name), null)); }
public static CultureInfo[] GetCultures(CultureTypes types) { return(Safe.Run(() => CultureInfo.GetCultures(types), new CultureInfo[0])); }
public static string Name <T>(Expression <Action <T> > ex) { return(Safe.Run(() => name(ex.Body), string.Empty)); }
public static string Name <T>(Expression <Func <T, object> > ex) { return(Safe.Run(() => name(ex.Body), string.Empty)); }
public static List <PropertyInfo> Properties(Type type, BindingFlags f = GetPublic.All) { return(Safe.Run(() => type.GetProperties(f).ToList(), new List <PropertyInfo>())); }
public static bool IsCountry(RegionInfo r) { return(Safe.Run(() => SystemString.StartsWithLetter(r.ThreeLetterISORegionName), false)); }
public static PropertyInfo Property <T>(string name) { return(Safe.Run(() => typeof(T).GetProperty(name), null)); }
public static int Count(Type type) { return(Safe.Run(() => Enum.GetValues(type).Length, -1)); }
public static T Value <T>(int i) { return(Safe.Run(() => (T)Value(typeof(T), i), default(T))); }