public override void ReadAndWrite() { using (BinaryReader reader = new BinaryReader(File.Open(FileName, FileMode.Open))) { while (reader.BaseStream.Position != reader.BaseStream.Length) { TradeRecord record = new TradeRecord { id = reader.ReadInt32(), account = reader.ReadInt32(), volume = reader.ReadDouble(), comment = reader.ReadString() }; Result.WriteRecord(record); } } }
public override void WriteRecord(TradeRecord record) { File.AppendAllText(FileName, record.ToCsvString()); }