public override List <TableDefinitionRecord> Visit(TpsFile file) { var tableMap = new Dictionary <int, List <TableDefinitionRecord> >(); var records = new List <TableDefinitionRecord>(); foreach (var record in file.GetAllRecords()) { var results = record.Accept(this); if (results == null) { continue; } foreach (var result in results) { List <TableDefinitionRecord> tableDefList; if (!tableMap.TryGetValue(result.TableNumber, out tableDefList)) { tableDefList = new List <TableDefinitionRecord>(); tableMap[result.TableNumber] = tableDefList; } tableDefList.Add(result); } } foreach (var pair in tableMap) { var definition = TableDefinitionRecord.Merge(pair.Value); definition.ParseData(); records.Add(definition); } return(records); }
public override List <DataRecord> Visit(TpsFile file) { var records = new List <DataRecord>(); foreach (var record in file.GetAllRecords()) { var result = record.Accept(this); if (result != null) { records.AddRange(result); } } return(records); }
public virtual T Visit(TpsFile file) { return(default(T)); }