Example #1
0
 private void FillCarList(ProductionReport report)
 {
     foreach (Factory factory in report.Factories)
     {
         CarList.AddRange(factory.ProducedCars);
     }
 }
Example #2
0
        private static Stream TransposeXML(string inputPath, string outputPath)
        {
            XDocument xml = XDocument.Load(inputPath);

            ProductionReport report = ProductionReport.Deserialize(xml);


            Serializer serializer = new Serializer();

            serializer.SerializeCars(report);

            if (outputPath != null)
            {
                serializer.SaveToFile(outputPath);
            }

            Stream stream = new MemoryStream();

            serializer.CarDocument.Save(stream);
            stream.Position = 0;

            return(stream);
        }
Example #3
0
        public void SerializeCars(ProductionReport report)
        {
            FillCarList(report);

            CreateXDocument();
        }