Example #1
0
        public CsvDataWriter(TextWriter writer, Type dataType, CsvSerializerContext serializer)
        {
            _serializer = serializer;
            _writer     = new CsvWriter(writer, serializer.Configuration);

            DataType = dataType;
        }
Example #2
0
        public CsvDataReader(TextReader reader, Type dataType, CsvSerializerContext serializer)
        {
            _serializer = serializer;
            _reader     = new CsvReader(reader, serializer.Configuration);

            DataType = dataType;
        }
Example #3
0
        private CsvSerializerContext CreateSerializer(DataAccess access, Type dataType, object settings)
        {
            var serializer = new CsvSerializerContext();

            serializer.Configuration.CultureInfo = System.Globalization.CultureInfo.GetCultureInfo("en-US");

            foreach (var configuration in Configurations.ToArray())
            {
                serializer = (CsvSerializerContext)configuration.Configure(serializer, access, dataType, settings)
                             ?? serializer;
            }

            return(serializer);
        }