public static object ParseFile(string f, Type t) { FileInfo fi = new FileInfo(f); if(!fi.Exists) return null; object val = null; using(var fs = fi.OpenRead()) { val = ParseNew(new StreamReader(fs).ReadToEnd(), t); } return val; }