/// <summary> /// Given a file, read its headers, and find a suitable importer for it /// </summary> public static Importer ImporterFor(CsvParser csv) { return(Importers.FirstOrDefault(i => i.Matches(csv))); }
private static Type ImporterForExtension(string ext) { return(Importers.FirstOrDefault(i => string.Equals(i.Value.Extension, ext, StringComparison.OrdinalIgnoreCase)).Key); }
internal Extension <IImporter> FindImporter(Type type) { return(Importers.SingleOrDefault(e => e.IsDefault && e.Value.TargetType == type) ?? Importers.FirstOrDefault(e => e.Value.TargetType == type)); }