Exemple #1
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();
        }
Exemple #2
0
 public CsvReader(CsvProfile profile, int bufferSize)
     : base(profile, bufferSize)
 {
     base.ProgressStatusChanged += (s, e) => ProgressStatusChanged?.Invoke(this, new ProgressStatusEventArgs(e.Status, e.Progress.Current, e.Progress.Total));
 }
Exemple #3
0
 public CsvReader(CsvProfile profile)
     : this(profile, 512)
 {
 }