Пример #1
0
 public FlatFileResultSetResolverArgs(IScalarResolver <string> path, string basePath, string parserName, IResultSetResolver redirection, IFlatFileProfile profile)
 {
     Path        = path;
     BasePath    = basePath;
     ParserName  = parserName;
     Redirection = redirection;
     Profile     = profile;
 }
Пример #2
0
        public IFlatFileReader Instantiate(string fileExtension, IFlatFileProfile profile)
        {
            if (string.IsNullOrEmpty(fileExtension))
            {
                var csvProfile = new CsvProfile(profile.Attributes);
                return(new CsvReader(csvProfile));
            }

            if (Readers.ContainsKey(fileExtension))
            {
                return(Instantiate(Readers[fileExtension]));
            }
            else if (Readers.ContainsKey("*.*"))
            {
                return(Instantiate(Readers["*.*"]));
            }
            throw new ArgumentException();
        }
Пример #3
0
 public FlatFileResultSetResolverArgs(IScalarResolver <string> resolverPath, string basePath, string parserName, IFlatFileProfile csvProfile)
     : this(resolverPath, basePath, parserName, null, csvProfile)
 {
 }