示例#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();
        }
示例#2
0
文件: CsvReader.cs 项目: ywscr/NBi
 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));
 }
示例#3
0
文件: CsvReader.cs 项目: ywscr/NBi
 public CsvReader(CsvProfile profile)
     : this(profile, 512)
 {
 }