예제 #1
0
        public void AddRecordedFileToSet(RecordLine line)
        {
            lock (_setLock) {
                if (_firstSetWrite)
                {
                    BeginSetWrite();
                    _firstSetWrite = false;
                }

                _setWriter.BeginRecord();
                _setWriter.WriteRecordLine(line);
                _setWriter.EndRecord();

                _writeCount++;
            }
        }
예제 #2
0
        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();
            }
        }