Beispiel #1
0
 /// <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)));
 }
Beispiel #2
0
 private static Type ImporterForExtension(string ext)
 {
     return(Importers.FirstOrDefault(i => string.Equals(i.Value.Extension, ext, StringComparison.OrdinalIgnoreCase)).Key);
 }
Beispiel #3
0
 internal Extension <IImporter> FindImporter(Type type)
 {
     return(Importers.SingleOrDefault(e => e.IsDefault && e.Value.TargetType == type)
            ?? Importers.FirstOrDefault(e => e.Value.TargetType == type));
 }