AppStore.Common.AppReader.readInfoFile C# (CSharp) Method

readInfoFile() public static method

It reads the Info App-Template, from the .buildmlearn file.
public static readInfoFile ( string fileName ) : void
fileName string Name of the file
return void
        public static void readInfoFile(string fileName)
        {
            try
            {
                InfoModel model = InfoModel.getInstance();
                List<string> infoTitleList = new List<string>();
                List<string> infoDescriptionList = new List<string>();
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(XDocument.Load("Assets/Apps/" + fileName + ".xml").ToString());
                model.setInfoName(doc.GetElementsByTagName("title").ElementAt(0).InnerText.Trim());
                model.setInfoDescription(doc.GetElementsByTagName("description").ElementAt(0).InnerText.Trim());
                string[] author = doc.GetElementsByTagName("author").ElementAt(0).InnerText.Split('\n');
                model.setInfoAuthor(author[1].Trim());
                model.setInfoAuthorEmail(author[2].Trim());
                model.setInfoVersion(doc.GetElementsByTagName("version").ElementAt(0).InnerText.Trim());
                XmlNodeList info_title = doc.GetElementsByTagName("item_title");
                XmlNodeList info_description = doc.GetElementsByTagName("item_description");
                for (int i = 0; i < info_title.Length; i++)
                {
                    infoTitleList.Add(info_title.ElementAt(i).InnerText.Trim());
                    infoDescriptionList.Add(info_description.ElementAt(i).InnerText.Trim());
                }
                model.setInfoTitleList(infoTitleList);
                model.setInfoDescriptionList(infoDescriptionList);
            }
            catch (Exception e)
            { }
        }