public void AddRecordedFileToSet(RecordLine line) { lock (_setLock) { if (_firstSetWrite) { BeginSetWrite(); _firstSetWrite = false; } _setWriter.BeginRecord(); _setWriter.WriteRecordLine(line); _setWriter.EndRecord(); _writeCount++; } }
public static void WriteToFile(RecordSet set, string path) { if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } using (var writer = new RecordSetWriter(System.IO.File.CreateText(path))) { writer.BeginWrite(); foreach (var record in set.Records) { writer.BeginRecord(); foreach (var line in record.Lines) { writer.WriteRecordLine(line); } writer.EndRecord(); } writer.EndWrite(); } }