Esempio n. 1
0
        /// <summary>
        /// Method Parse
        /// Gets the address of the Json file and starts ParseJsonFile method.
        /// </summary>
        /// <returns>Parsed list of strings.</returns>
        public override List <string> Parse()
        {
            FileToStringConverter jsonConverter = new FileToStringConverter();
            string json = jsonConverter.Convert(FileAddress);

            ParseJsonFile(json);
            return(Result.XmlResult);
        }
Esempio n. 2
0
        /// <summary>
        /// Method Parse
        /// Gets the address of the XML file and starts ParsingXML method.
        /// </summary>
        /// <returns>Parsed list of strings.</returns>
        public override List <string> Parse()
        {
            try
            {
                if (FileAddress == null)
                {
                    throw new Exception("Empty address.");
                }
                // Convert the file to a string.
                var XmlToStringConverter = new FileToStringConverter();
                XmlString = XmlToStringConverter.Convert(FileAddress);
                ParsingXml();

                return(Result.XmlResult);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }