SharpTuneCore.ECUMetaData.ReadEcuFlashRomTables C# (CSharp) Method

ReadEcuFlashRomTables() public method

public ReadEcuFlashRomTables ( XDocument xmlDoc, IXmlLineInfo info ) : bool
xmlDoc XDocument
info IXmlLineInfo
return bool
        public bool ReadEcuFlashRomTables(XDocument xmlDoc, IXmlLineInfo info)
        {
            // ROM table fetches here!
            var tableQuery = from t in xmlDoc.XPathSelectElements("/rom/table")
                                select t;
            foreach (XElement table in tableQuery)
            {
                try
                {
                    info = (IXmlLineInfo)table;
                    if (table.Attribute("name") == null)
                        throw new Exception("Error, table name is null!");
                    string tablename = table.Attribute("name").Value.ToString();
                    AddRomTable(TableFactory.CreateTable(table, tablename, this), info.LineNumber);
                }
                catch (Exception crap)
                {
                    Trace.WriteLine("Error reading tables in " + filePath + " Line number: " + info.LineNumber);
                    Trace.WriteLine(crap.Message);
                    throw;
                }
            }
            return true;
        }