Example #1
0
        // private readonly TextWriter _supplierWriter;

        public CsvOutputWriter(WriterConfiguration configuration)
        {
            var pool = new DefaultObjectPool <StringBuilder>(new StringBuilderPooledObjectPolicy());

            _detailGenerator         = new CsvDetailGenerator(pool);
            _linkGenerator           = new CsvLinkGenerator(pool);
            _marketingGenerator      = new CsvMarketingGenerator(pool);
            _optionsGenerator        = new CsvOptionsGenerator(pool);
            _productGenerator        = new CsvProductGenerator(pool);
            _specificationsGenerator = new CsvSpecificationsGenerator(pool);
            //_supplierGenerator = new CsvSupplierGenerator();

            _detailWriter = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath,
                                                                         configuration.CsvDirectory, configuration.DetailFileName)));
            _linkWriter = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath,
                                                                       configuration.CsvDirectory, configuration.LinkFileName)));
            _marketingWriter = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath,
                                                                            configuration.CsvDirectory, configuration.MarketingFileName)));
            _optionsWriter = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath,
                                                                          configuration.CsvDirectory, configuration.OptionFileName)));
            _productWriter = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath,
                                                                          configuration.CsvDirectory, configuration.ProductFileName)));
            _specificationsWriter = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath,
                                                                                 configuration.CsvDirectory, configuration.SpecificationFileName)));
            //_supplierWriter = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath, "supplier.txt")));
        }
Example #2
0
        public JsonOutputWriter(WriterConfiguration configuration)
        {
            var configuration1 = configuration;
            var textWriter     = new StreamWriter(File.OpenWrite(Path.Combine(configuration1.OutputPath,
                                                                              configuration1.JsonDirectory, configuration1.JsonFileName)));

            _jsonWriter = new JsonTextWriter(textWriter)
            {
                AutoCompleteOnClose = true,
                CloseOutput         = true,
                Formatting          = Formatting.Indented
            };
            _jsonWriter.WriteStartArray();
        }
Example #3
0
 public CsvSupplierOutputWriter(WriterConfiguration configuration)
 {
     _supplierGenerator = new CsvSupplierGenerator();
     _supplierWriter    = new StreamWriter(File.OpenWrite(Path.Combine(configuration.OutputPath,
                                                                       configuration.CsvDirectory, configuration.SupplierFileName)));
 }