/// <inheritdoc />
        public void Visit(IdentifierDefinition definition, CompositeDefinitionType type)
        {
            var subWriters = new IdentifierValueOutputFormatter(
                type.Identifiers.Cast <IdentifierDefinition>(),
                FieldNames[definition.SystemName]
                );

            Writers[definition.SystemName] = subWriters.WriteCompositeValue;
        }
Esempio n. 2
0
        public void Write(
            IEnumerable <IdentifierDefinition> definitions,
            string[][] fieldNames,
            IEnumerable <T> studySubjects)
        {
            var outputFormatter = new IdentifierValueOutputFormatter(definitions, fieldNames);

            using (var csv = new CsvWriter(CreateOutputWriter()))
            {
                WriteHeader(csv, fieldNames);
                var writer = new Writer(csv, GetId, outputFormatter);

                foreach (var subject in studySubjects)
                {
                    writer.Write(subject);
                }
            }
        }
Esempio n. 3
0
 public Writer(IWriter csv, Func <T, string> getId, IdentifierValueOutputFormatter outputFormatter)
 {
     Csv             = csv;
     GetId           = getId;
     OutputFormatter = outputFormatter;
 }