public void Load(string filesDirectory) { // initialize CSV reader/writer CSVTable table = new CSVTable(filesDirectory, this.TableName, this.columnDefinitions); // initialize postload cache this.loadCache = new List <PostLoadData <T> >(); // read the CSV List <CSVTableRow> rows = table.Load(); foreach (CSVTableRow row in rows) { T item = this.LoadItem(row); int id = item.ID; // add to postload cache this.loadCache.Add(new PostLoadData <T>(row, item)); this.AddItem(id, item); if (this.lastID < id) { this.lastID = id; } } }
public void Load(string filesDirectory, Domain domain) { // initialize CSV reader/writer CSVTable table = new CSVTable(filesDirectory, this.TableName, this.columnDefinitions); // initialize postload cache this.loadCache = new List <PostLoadData <T> >(); // read the CSV List <CSVTableRow> rows = table.Load(); foreach (CSVTableRow row in rows) { T item = this.LoadItem(row); string id = ItemIdentifier.CreateIdentifierString(domain, this.TableName, item.InnerName); // add to postload cache this.loadCache.Add(new PostLoadData <T>(row, item)); this.AddItem(id, item); } }