private void EndSetWrite() { lock (_setLock) { if (_setWriter != null && _writeCount > 0) { _setWriter.EndWrite(); _setWriter.Dispose(); _setFileHandle.Dispose(); } } }
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(); } }