Example #1
0
 public IEnumerable <Data> ReadXMLFile(string fullFilePath)
 {
     using (StreamReader reader = new StreamReader(fullFilePath))
     {
         using (XMLFileReaderWriter rw = new XMLFileReaderWriter(reader))
         {
             foreach (var item in rw.Read())
             {
                 yield return(item);
             }
         }
     }
 }
Example #2
0
        public void WriteXMLFile(string fullFilePath, int count, FrequencyEnum frequency)
        {
            RandomDataGenerator generator = new RandomDataGenerator();

            using (StreamWriter file = new StreamWriter(fullFilePath))
            {
                using (XMLFileReaderWriter rw = new XMLFileReaderWriter(file))
                {
                    foreach (var item in generator.YieldRandomData(count, frequency))
                    {
                        rw.Write(item);
                    }
                }
            }
        }